Class: Nydp::StringAtom
- Inherits:
-
Object
- Object
- Nydp::StringAtom
- Defined in:
- lib/nydp/string_atom.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
Returns the value of attribute string.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(string, token = nil) ⇒ StringAtom
constructor
A new instance of StringAtom.
- #inspect ⇒ Object
- #nydp_type ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(string, token = nil) ⇒ StringAtom
Returns a new instance of StringAtom.
4 5 6 |
# File 'lib/nydp/string_atom.rb', line 4 def initialize string, token=nil @string, @token = string, token end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
3 4 5 |
# File 'lib/nydp/string_atom.rb', line 3 def string @string end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/nydp/string_atom.rb', line 3 def token @token end |
Instance Method Details
#+(other) ⇒ Object
19 20 21 |
# File 'lib/nydp/string_atom.rb', line 19 def + other StringAtom.new "#{@string}#{other}" end |
#==(other) ⇒ Object
15 16 17 |
# File 'lib/nydp/string_atom.rb', line 15 def == other other.to_s == self.to_s end |
#inspect ⇒ Object
11 12 13 |
# File 'lib/nydp/string_atom.rb', line 11 def inspect string.inspect end |
#nydp_type ⇒ Object
8 |
# File 'lib/nydp/string_atom.rb', line 8 def nydp_type ; :string ; end |
#to_s ⇒ Object
9 |
# File 'lib/nydp/string_atom.rb', line 9 def to_s ; string ; end |