Class: SgtnClient::Common::BundleID

Inherits:
Object
  • Object
show all
Defined in:
lib/sgtn-client/common/data.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component, locale) ⇒ BundleID

Returns a new instance of BundleID.



12
13
14
15
16
# File 'lib/sgtn-client/common/data.rb', line 12

def initialize(component, locale)
  @locale = locale
  @component = component
  @key = [@component, @locale].hash
end

Instance Attribute Details

#componentObject (readonly)

Returns the value of attribute component.



10
11
12
# File 'lib/sgtn-client/common/data.rb', line 10

def component
  @component
end

#localeObject (readonly)

Returns the value of attribute locale.



10
11
12
# File 'lib/sgtn-client/common/data.rb', line 10

def locale
  @locale
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



22
23
24
# File 'lib/sgtn-client/common/data.rb', line 22

def ==(other)
  (other.is_a? self.class) && @locale == other.locale && @component == other.component
end

#hashObject



18
19
20
# File 'lib/sgtn-client/common/data.rb', line 18

def hash
  @key
end

#to_sObject



28
29
30
# File 'lib/sgtn-client/common/data.rb', line 28

def to_s
  "{component: #{@component}, locale: #{@locale}}"
end