Class: Nendo::LispKeyword

Inherits:
Object
  • Object
show all
Defined in:
lib/nendo/ruby/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (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

Returns:

  • (Boolean)


210
211
212
# File 'lib/nendo/ruby/types.rb', line 210

def equal?(other)
  self.==(other)
end

#to_sObject



214
215
216
# File 'lib/nendo/ruby/types.rb', line 214

def to_s
  self.key.to_s
end