Class: Nydp::StringAtom
Instance Attribute Summary collapse
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
- #*(other) ⇒ Object
- #+(other) ⇒ Object
- #<(other) ⇒ Object
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(string) ⇒ StringAtom
constructor
A new instance of StringAtom.
- #inspect ⇒ Object
- #length ⇒ Object
- #nydp_type ⇒ Object
- #to_date ⇒ Object
- #to_ruby ⇒ Object
- #to_s ⇒ Object
- #to_sym ⇒ Object
Constructor Details
#initialize(string) ⇒ StringAtom
Returns a new instance of StringAtom.
5 |
# File 'lib/nydp/string_atom.rb', line 5 def initialize string ; @string = string ; 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 |
Instance Method Details
#*(other) ⇒ Object
18 |
# File 'lib/nydp/string_atom.rb', line 18 def * other ; StringAtom.new(string * other) ; end |
#+(other) ⇒ Object
20 |
# File 'lib/nydp/string_atom.rb', line 20 def + other ; StringAtom.new "#{@string}#{other}" ; end |
#<(other) ⇒ Object
17 |
# File 'lib/nydp/string_atom.rb', line 17 def < other ; self.string < other.string ; end |
#<=>(other) ⇒ Object
19 |
# File 'lib/nydp/string_atom.rb', line 19 def <=> other ; self < other ? -1 : (self == other ? 0 : 1) ; end |
#==(other) ⇒ Object
22 23 24 |
# File 'lib/nydp/string_atom.rb', line 22 def == other other.is_a?(Nydp::StringAtom) && (other.to_s == self.to_s) end |
#>(other) ⇒ Object
16 |
# File 'lib/nydp/string_atom.rb', line 16 def > other ; self.string > other.string ; end |
#eql?(other) ⇒ Boolean
12 |
# File 'lib/nydp/string_atom.rb', line 12 def eql? other ; self == other ; end |
#hash ⇒ Object
14 |
# File 'lib/nydp/string_atom.rb', line 14 def hash ; string.hash ; end |
#inspect ⇒ Object
13 |
# File 'lib/nydp/string_atom.rb', line 13 def inspect ; string.inspect ; end |
#length ⇒ Object
15 |
# File 'lib/nydp/string_atom.rb', line 15 def length ; string.length ; end |
#nydp_type ⇒ Object
7 |
# File 'lib/nydp/string_atom.rb', line 7 def nydp_type ; :string ; end |
#to_date ⇒ Object
11 |
# File 'lib/nydp/string_atom.rb', line 11 def to_date ; ::Date.parse(@string) ; end |
#to_ruby ⇒ Object
9 |
# File 'lib/nydp/string_atom.rb', line 9 def to_ruby ; string ; end |
#to_s ⇒ Object
8 |
# File 'lib/nydp/string_atom.rb', line 8 def to_s ; string ; end |
#to_sym ⇒ Object
10 |
# File 'lib/nydp/string_atom.rb', line 10 def to_sym ; string.to_sym ; end |