Class: Ninja::Variable
- Inherits:
-
Object
- Object
- Ninja::Variable
- Defined in:
- lib/ninja/variable.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value) ⇒ Variable
constructor
A new instance of Variable.
Constructor Details
#initialize(name, value) ⇒ Variable
Returns a new instance of Variable.
6 7 8 9 10 11 12 |
# File 'lib/ninja/variable.rb', line 6 def initialize(name, value) raise "Name not specified." unless name raise "Expected name to be a string made of [a-Z,_,-,0-9] characters." unless /\w/.match(name) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/ninja/variable.rb', line 3 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/ninja/variable.rb', line 3 def value @value end |