Class: SpreeOxygenPelatologio::PullProducts

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_oxygen_pelatologio/pull_products.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePullProducts

Returns a new instance of PullProducts.



5
6
7
# File 'app/services/spree_oxygen_pelatologio/pull_products.rb', line 5

def initialize
  @client = SpreeOxygenPelatologio::Client.new
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'app/services/spree_oxygen_pelatologio/pull_products.rb', line 3

def client
  @client
end

Instance Method Details

#callObject



9
10
11
12
13
# File 'app/services/spree_oxygen_pelatologio/pull_products.rb', line 9

def call
  client.call(:pull_products) do |products|
    products.each { |product| update_product(product) }
  end
end