Class: Schron::Test::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/schron/test/entity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Entity

Returns a new instance of Entity.



6
7
8
# File 'lib/schron/test/entity.rb', line 6

def initialize(attrs={})
  @attributes = attrs
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/schron/test/entity.rb', line 5

def attributes
  @attributes
end

Instance Method Details

#==(entity) ⇒ Object



14
15
16
# File 'lib/schron/test/entity.rb', line 14

def ==(entity)
  entity.is_a?(self.class) && attributes == entity.attributes
end

#idObject



10
11
12
# File 'lib/schron/test/entity.rb', line 10

def id
  attributes[:id]
end