Class: Nendo::LispKeyword
- Inherits:
-
Object
- Object
- Nendo::LispKeyword
- Defined in:
- lib/nendo/ruby/types.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #===(other) ⇒ Object
- #equal?(other) ⇒ Boolean
-
#initialize(str) ⇒ LispKeyword
constructor
A new instance of LispKeyword.
- #to_s ⇒ Object
Constructor Details
#initialize(str) ⇒ LispKeyword
Returns a new instance of LispKeyword.
194 195 196 |
# File 'lib/nendo/ruby/types.rb', line 194 def initialize( str ) @key = str.intern end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
218 219 220 |
# File 'lib/nendo/ruby/types.rb', line 218 def key @key end |
Instance Method Details
#==(other) ⇒ Object
198 199 200 201 202 203 204 |
# File 'lib/nendo/ruby/types.rb', line 198 def ==(other) if other.is_a? LispKeyword self.key.intern == other.key.intern else false end end |
#===(other) ⇒ Object
206 207 208 |
# File 'lib/nendo/ruby/types.rb', line 206 def ===(other) self.==(other) end |
#equal?(other) ⇒ Boolean
210 211 212 |
# File 'lib/nendo/ruby/types.rb', line 210 def equal?(other) self.==(other) end |
#to_s ⇒ Object
214 215 216 |
# File 'lib/nendo/ruby/types.rb', line 214 def to_s self.key.to_s end |