Class: Vop::ThingWithParams
- Inherits:
-
Object
- Object
- Vop::ThingWithParams
- Defined in:
- lib/vop/objects/thing_with_params.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize ⇒ ThingWithParams
constructor
A new instance of ThingWithParams.
- #param(name) ⇒ Object
Constructor Details
#initialize ⇒ ThingWithParams
Returns a new instance of ThingWithParams.
7 8 9 |
# File 'lib/vop/objects/thing_with_params.rb', line 7 def initialize @params = [] end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/vop/objects/thing_with_params.rb', line 5 def params @params end |
Instance Method Details
#param(name) ⇒ Object
11 12 13 |
# File 'lib/vop/objects/thing_with_params.rb', line 11 def param(name) @params.select { |x| x.name == name }.first end |