Class: Ninja::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/ninja/variable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/ninja/variable.rb', line 3

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/ninja/variable.rb', line 3

def value
  @value
end