Class: SgtnClient::Common::BundleID

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component, locale) ⇒ BundleID

Returns a new instance of BundleID.



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

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

Instance Attribute Details

#componentObject (readonly)

Returns the value of attribute component.



7
8
9
# File 'lib/sgtn-client/common/data.rb', line 7

def component
  @component
end

#localeObject (readonly)

Returns the value of attribute locale.



7
8
9
# File 'lib/sgtn-client/common/data.rb', line 7

def locale
  @locale
end

Instance Method Details

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



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

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

#hashObject



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

def hash
  @key
end

#to_sObject



25
26
27
# File 'lib/sgtn-client/common/data.rb', line 25

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