Class: Spree::DataFeeds::Google::OptionalAttributes

Inherits:
Object
  • Object
show all
Includes:
ServiceModule::Base
Defined in:
app/services/spree/data_feeds/google/optional_attributes.rb

Instance Method Summary collapse

Methods included from ServiceModule::Base

prepended

Instance Method Details

#call(input) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/services/spree/data_feeds/google/optional_attributes.rb', line 7

def call(input)
  information = {}

  input[:product].property_ids.each do |key|
    name = Spree::Property.find(key)&.name
    value = input[:product].property(name)
    unless value.nil?
      information[name] = value
    end
  end

  success(information: information)
end