Class: NScript::Value
- Inherits:
-
Object
- Object
- NScript::Value
- Defined in:
- lib/nscript/value.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](index) ⇒ Object
- #children ⇒ Object
- #compile(o = {}) ⇒ Object
- #contains? ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(value, line = nil) ⇒ Value
constructor
A new instance of Value.
- #inspect ⇒ Object
- #match(regex) ⇒ Object
- #statement_only? ⇒ Boolean
- #to_str ⇒ Object (also: #to_s)
- #to_sym ⇒ Object
Constructor Details
#initialize(value, line = nil) ⇒ Value
Returns a new instance of Value.
7 8 9 |
# File 'lib/nscript/value.rb', line 7 def initialize(value, line=nil) @value, @line = value, line end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
5 6 7 |
# File 'lib/nscript/value.rb', line 5 def line @line end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/nscript/value.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 |
# File 'lib/nscript/value.rb', line 28 def ==(other) @value == other end |
#[](index) ⇒ Object
32 33 34 |
# File 'lib/nscript/value.rb', line 32 def [](index) @value[index] end |
#children ⇒ Object
48 49 50 |
# File 'lib/nscript/value.rb', line 48 def children [] end |
#compile(o = {}) ⇒ Object
20 21 22 |
# File 'lib/nscript/value.rb', line 20 def compile(o={}) to_s end |
#contains? ⇒ Boolean
56 57 58 |
# File 'lib/nscript/value.rb', line 56 def contains? false end |
#eql?(other) ⇒ Boolean
36 37 38 |
# File 'lib/nscript/value.rb', line 36 def eql?(other) @value.eql?(other) end |
#hash ⇒ Object
40 41 42 |
# File 'lib/nscript/value.rb', line 40 def hash @value.hash end |
#inspect ⇒ Object
24 25 26 |
# File 'lib/nscript/value.rb', line 24 def inspect @value.inspect end |
#match(regex) ⇒ Object
44 45 46 |
# File 'lib/nscript/value.rb', line 44 def match(regex) @value.match(regex) end |
#statement_only? ⇒ Boolean
52 53 54 |
# File 'lib/nscript/value.rb', line 52 def statement_only? false end |
#to_str ⇒ Object Also known as: to_s
11 12 13 |
# File 'lib/nscript/value.rb', line 11 def to_str @value.to_s end |
#to_sym ⇒ Object
16 17 18 |
# File 'lib/nscript/value.rb', line 16 def to_sym to_str.to_sym end |