Class: Nydp::Symbol
- Inherits:
-
Object
- Object
- Nydp::Symbol
- Defined in:
- lib/nydp/symbol.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #assign(value, context = nil) ⇒ Object
-
#initialize(name) ⇒ Symbol
constructor
A new instance of Symbol.
- #inspect ⇒ Object
- #is?(nm) ⇒ Boolean
- #nydp_type ⇒ Object
- #to_s ⇒ Object
- #value(context = nil) ⇒ Object
Constructor Details
#initialize(name) ⇒ Symbol
Returns a new instance of Symbol.
4 5 6 |
# File 'lib/nydp/symbol.rb', line 4 def initialize name @name = name.to_sym end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/nydp/symbol.rb', line 2 def name @name end |
Class Method Details
.find(name, ns) ⇒ Object
28 29 30 |
# File 'lib/nydp/symbol.rb', line 28 def self.find name, ns ns[name.to_sym] end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 |
# File 'lib/nydp/symbol.rb', line 36 def == other other.is_a?(Nydp::Symbol) && (self.name == other.name) end |
#assign(value, context = nil) ⇒ Object
40 41 42 |
# File 'lib/nydp/symbol.rb', line 40 def assign value, context=nil @value = value end |
#inspect ⇒ Object
33 |
# File 'lib/nydp/symbol.rb', line 33 def inspect ; to_s ; end |
#is?(nm) ⇒ Boolean
8 9 10 |
# File 'lib/nydp/symbol.rb', line 8 def is? nm self.name == nm.to_sym end |
#nydp_type ⇒ Object
32 |
# File 'lib/nydp/symbol.rb', line 32 def nydp_type ; :symbol ; end |
#to_s ⇒ Object
34 |
# File 'lib/nydp/symbol.rb', line 34 def to_s ; name.to_s ; end |
#value(context = nil) ⇒ Object
12 13 14 |
# File 'lib/nydp/symbol.rb', line 12 def value context=nil @value || Nydp.NIL end |