Passing in dynamic parameter names to Origen::Parameters?

rchitect-of-info

After looking at the Origen Parameters feature, I was wondering if it is possible to dynamically pass variables as names within the parameter scope. For example:

[:tprog, :terase].each do |p|
  define_params :default do |params|
    params.send(p, 20.uS)
  end
end

thx

Ginty

Yes it's possible.

Your example doesn't work as written though since the method you are trying to call to define the parameter is tprog= and not just tprog.

So this would work:

[:tprog, :terase].each do |p|
  define_params :default do |params|
    params.send("#{p}=", 20.us)
  end
end

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Passing variables into the names_glue parameter of tidyr::pivot_wider

From Dev

Passing table names in an array

From Dev

Python MySQL parameter queries for dynamic table names

From Dev

Passing in batch file with parameters as parameter in sftp command

From Dev

Passing "get" parameters doesn't work, parameter not visible in the link

From Dev

lisp: dynamic scope vs explicit parameter passing

From Dev

Passing dynamic input field array item values with different names to php

From Dev

How to cover a void method that avoids null parameters by passing a null parameter?

From Dev

dynamic list of parameters without having repeated parameter name

From Dev

Twig - passing a parameter to a function with a dynamic variable name

From Dev

Angular JS routing control with dynamic parameter passing

From Dev

Passing dynamic parameters to CMD and saving the command

From Dev

Passing dynamic string in hyperlink as parameter in jsp

From Dev

Python - passing a method with parameters as parameter to another method - assigning default

From Dev

Python MySQL parameter queries for dynamic table names

From Dev

Passing dynamic parameters to a function (NOT arguments) in PHP

From Dev

Passing dynamic parameters into a function

From Dev

Passing "get" parameters doesn't work, parameter not visible in the link

From Dev

passing parameters in find of dynamic model

From Dev

Data type error when passing dynamic column names into SQL Server

From Dev

Passing URL with query parameters as function parameter in JavaScript

From Dev

Share variable between subroutines without global variable names collisions, declaration out-of-subroutine, or passing parameters

From Dev

Dynamic SQL with Dynamic Parameters

From Dev

How can I recursively create output files by passing directory names as parameters?

From Dev

Documentation of manually passing parameters ${parameter} inside query

From Dev

How can I discover parameter attributes for dynamic parameters?

From Dev

Passing parameters with <>?

From Dev

Wrapping Origen::Parameters define_params method

From Dev

Dynamic Parameter with "or"

Related Related

  1. 1

    Passing variables into the names_glue parameter of tidyr::pivot_wider

  2. 2

    Passing table names in an array

  3. 3

    Python MySQL parameter queries for dynamic table names

  4. 4

    Passing in batch file with parameters as parameter in sftp command

  5. 5

    Passing "get" parameters doesn't work, parameter not visible in the link

  6. 6

    lisp: dynamic scope vs explicit parameter passing

  7. 7

    Passing dynamic input field array item values with different names to php

  8. 8

    How to cover a void method that avoids null parameters by passing a null parameter?

  9. 9

    dynamic list of parameters without having repeated parameter name

  10. 10

    Twig - passing a parameter to a function with a dynamic variable name

  11. 11

    Angular JS routing control with dynamic parameter passing

  12. 12

    Passing dynamic parameters to CMD and saving the command

  13. 13

    Passing dynamic string in hyperlink as parameter in jsp

  14. 14

    Python - passing a method with parameters as parameter to another method - assigning default

  15. 15

    Python MySQL parameter queries for dynamic table names

  16. 16

    Passing dynamic parameters to a function (NOT arguments) in PHP

  17. 17

    Passing dynamic parameters into a function

  18. 18

    Passing "get" parameters doesn't work, parameter not visible in the link

  19. 19

    passing parameters in find of dynamic model

  20. 20

    Data type error when passing dynamic column names into SQL Server

  21. 21

    Passing URL with query parameters as function parameter in JavaScript

  22. 22

    Share variable between subroutines without global variable names collisions, declaration out-of-subroutine, or passing parameters

  23. 23

    Dynamic SQL with Dynamic Parameters

  24. 24

    How can I recursively create output files by passing directory names as parameters?

  25. 25

    Documentation of manually passing parameters ${parameter} inside query

  26. 26

    How can I discover parameter attributes for dynamic parameters?

  27. 27

    Passing parameters with <>?

  28. 28

    Wrapping Origen::Parameters define_params method

  29. 29

    Dynamic Parameter with "or"

HotTag

Archive