Class: Carpenter::Model::Param
- Inherits:
-
Object
- Object
- Carpenter::Model::Param
- Defined in:
- lib/struct_declaration.rb,
lib/carpenter/model/param.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #dup ⇒ Object
-
#initialize(name, value, **options) ⇒ Param
constructor
A new instance of Param.
- #valid? ⇒ Boolean
Constructor Details
#initialize(name, value, **options) ⇒ Param
Returns a new instance of Param.
5 6 7 8 9 |
# File 'lib/carpenter/model/param.rb', line 5 def initialize(name, value, **) @name = name @value = value @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/carpenter/model/param.rb', line 2 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/carpenter/model/param.rb', line 2 def @options end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/carpenter/model/param.rb', line 3 def value @value end |
Instance Method Details
#dup ⇒ Object
11 12 13 |
# File 'lib/carpenter/model/param.rb', line 11 def dup self.class.new(name, value, **) end |
#valid? ⇒ Boolean
15 16 17 18 19 |
# File 'lib/carpenter/model/param.rb', line 15 def valid? return false if @options[:force] && @value.nil? true end |