Class: Store::Ref

Inherits:
Object
  • Object
show all
Defined in:
lib/store/ref.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity_type, reference) ⇒ Ref

Returns a new instance of Ref.



5
6
7
8
# File 'lib/store/ref.rb', line 5

def initialize(entity_type, reference)
  @entity_type = entity_type
  @reference = reference
end

Instance Attribute Details

#entity_typeObject (readonly)

Returns the value of attribute entity_type.



3
4
5
# File 'lib/store/ref.rb', line 3

def entity_type
  @entity_type
end

#referenceObject (readonly)

Returns the value of attribute reference.



3
4
5
# File 'lib/store/ref.rb', line 3

def reference
  @reference
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
13
14
15
# File 'lib/store/ref.rb', line 10

def ==(other)
  other.respond_to?(:entity_type) &&
    other.respond_to?(:reference) &&
    self.entity_type == other.entity_type &&
    self.reference == other.reference
end