class Talkgh::Entity

Attributes

attributes[R]

Public Class Methods

new(**kwargs) click to toggle source
# File lib/talkgh/entity.rb, line 5
def initialize(**kwargs)
  @attributes = kwargs
end

Public Instance Methods

==(entity) click to toggle source
# File lib/talkgh/entity.rb, line 23
def ==(entity)
  entity.class == self.class && entity.attributes == @attributes
end
[]=(key, value) click to toggle source
# File lib/talkgh/entity.rb, line 9
def []=(key, value)
  @attributes[attribute_key(key)] = value
end
method_missing(name, *args) click to toggle source
Calls superclass method
# File lib/talkgh/entity.rb, line 17
def method_missing(name, *args)
  return super unless @attributes.key?(name)
  
  @attributes[name]
end
respond_to_missing?(name, include_private = false) click to toggle source
Calls superclass method
# File lib/talkgh/entity.rb, line 13
def respond_to_missing?(name, include_private = false)
  @attributes.key?(name) or super
end
to_h() click to toggle source
# File lib/talkgh/entity.rb, line 27
def to_h
  @attributes
end