Class: Io::Flow::V0::Models::IncomingFeedFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ IncomingFeedFormat

Returns a new instance of IncomingFeedFormat.



13427
13428
13429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13427

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13425
13426
13427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13425

def value
  @value
end

Class Method Details

.ALLObject



13447
13448
13449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13447

def IncomingFeedFormat.ALL
  @@all ||= [IncomingFeedFormat.google_xml, IncomingFeedFormat.google_sheet]
end

.apply(value) ⇒ Object

Returns the instance of IncomingFeedFormat for this value, creating a new instance for an unknown value



13432
13433
13434
13435
13436
13437
13438
13439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13432

def IncomingFeedFormat.apply(value)
  if value.instance_of?(IncomingFeedFormat)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || IncomingFeedFormat.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of IncomingFeedFormat for this value, or nil if not found



13442
13443
13444
13445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13442

def IncomingFeedFormat.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  IncomingFeedFormat.ALL.find { |v| v.value == value }
end

.google_sheetObject

Google Sheet-based product catalog feed



13457
13458
13459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13457

def IncomingFeedFormat.google_sheet
  @@_google_sheet ||= IncomingFeedFormat.new('google-sheet')
end

.google_xmlObject

Google RSS-like product catalog feed



13452
13453
13454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13452

def IncomingFeedFormat.google_xml
  @@_google_xml ||= IncomingFeedFormat.new('google-xml')
end

Instance Method Details

#to_hashObject



13461
13462
13463
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13461

def to_hash
  value
end