Class: BestBuy::Store

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_params) ⇒ Store

Returns a new instance of Store.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/best_buy/models/store.rb', line 13

def initialize(init_params)
  @location_type = init_params[:location_type]
  @long_name = init_params[:long_name]
  @name = init_params[:name]
  @opening_time = init_params[:detailed_hours]
  @phone = init_params[:phone]
  @services = init_params[:services]&.map { |service_hash| service_hash[:service] }
  @store_id = init_params[:store_id]
  @store_type = init_params[:store_type]

  @store_address = Address.new(init_params)
end

Instance Attribute Details

#location_typeObject (readonly)

Returns the value of attribute location_type.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def location_type
  @location_type
end

#long_nameObject (readonly)

Returns the value of attribute long_name.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def long_name
  @long_name
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def name
  @name
end

#opening_timeObject (readonly)

Returns the value of attribute opening_time.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def opening_time
  @opening_time
end

#phoneObject (readonly)

Returns the value of attribute phone.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def phone
  @phone
end

#servicesObject (readonly)

Returns the value of attribute services.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def services
  @services
end

#store_addressObject (readonly)

Returns the value of attribute store_address.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def store_address
  @store_address
end

#store_idObject (readonly)

Returns the value of attribute store_id.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def store_id
  @store_id
end

#store_typeObject (readonly)

Returns the value of attribute store_type.



7
8
9
# File 'lib/best_buy/models/store.rb', line 7

def store_type
  @store_type
end