Class: AppleStoreInventoryChecker::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_store_inventory_checker/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_id:) ⇒ Result

Returns a new instance of Result.



15
16
17
# File 'lib/apple_store_inventory_checker/result.rb', line 15

def initialize(product_id:)
  @product_id = product_id
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



3
4
5
# File 'lib/apple_store_inventory_checker/result.rb', line 3

def city
  @city
end

#distanceObject

Returns the value of attribute distance.



4
5
6
# File 'lib/apple_store_inventory_checker/result.rb', line 4

def distance
  @distance
end

#in_stock=(value) ⇒ Object (writeonly)

Sets the attribute in_stock

Parameters:

  • value

    the value to set the attribute in_stock to.



13
14
15
# File 'lib/apple_store_inventory_checker/result.rb', line 13

def in_stock=(value)
  @in_stock = value
end

#phoneObject

Returns the value of attribute phone.



5
6
7
# File 'lib/apple_store_inventory_checker/result.rb', line 5

def phone
  @phone
end

#productObject

Returns the value of attribute product.



6
7
8
# File 'lib/apple_store_inventory_checker/result.rb', line 6

def product
  @product
end

#product_idObject (readonly)

Returns the value of attribute product_id.



11
12
13
# File 'lib/apple_store_inventory_checker/result.rb', line 11

def product_id
  @product_id
end

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/apple_store_inventory_checker/result.rb', line 7

def state
  @state
end

#storeObject

Returns the value of attribute store.



8
9
10
# File 'lib/apple_store_inventory_checker/result.rb', line 8

def store
  @store
end

#urlObject

Returns the value of attribute url.



9
10
11
# File 'lib/apple_store_inventory_checker/result.rb', line 9

def url
  @url
end

Instance Method Details

#in_stock?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/apple_store_inventory_checker/result.rb', line 19

def in_stock?
  @in_stock
end