Class: Io::Flow::V0::Models::CatalogFeed
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Describes a catalog feed.
Instance Attribute Summary collapse
-
#experience_feed_summaries ⇒ Object
readonly
Returns the value of attribute experience_feed_summaries.
-
#feed_statistics_summary ⇒ Object
readonly
Returns the value of attribute feed_statistics_summary.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#incoming_feed ⇒ Object
readonly
Returns the value of attribute incoming_feed.
-
#outgoing_feed ⇒ Object
readonly
Returns the value of attribute outgoing_feed.
Attributes inherited from Feed
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CatalogFeed
constructor
A new instance of CatalogFeed.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Feed
Constructor Details
#initialize(incoming = {}) ⇒ CatalogFeed
Returns a new instance of CatalogFeed.
15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15620 def initialize(incoming={}) super(:discriminator => Feed::Types::CATALOG_FEED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :experience_feed_summaries, :incoming_feed, :outgoing_feed, :feed_statistics_summary], 'CatalogFeed') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @experience_feed_summaries = HttpClient::Preconditions.assert_class('experience_feed_summaries', opts.delete(:experience_feed_summaries), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExperienceFeedSummary) ? x : ::Io::Flow::V0::Models::ExperienceFeedSummary.new(x)) } @incoming_feed = (x = opts.delete(:incoming_feed); x.is_a?(::Io::Flow::V0::Models::IncomingFeed) ? x : ::Io::Flow::V0::Models::IncomingFeed.new(x)) @outgoing_feed = (x = opts.delete(:outgoing_feed); x.is_a?(::Io::Flow::V0::Models::OutgoingFeed) ? x : ::Io::Flow::V0::Models::OutgoingFeed.new(x)) @feed_statistics_summary = (x = opts.delete(:feed_statistics_summary); x.is_a?(::Io::Flow::V0::Models::FeedStatisticsSummary) ? x : ::Io::Flow::V0::Models::FeedStatisticsSummary.new(x)) end |
Instance Attribute Details
#experience_feed_summaries ⇒ Object (readonly)
Returns the value of attribute experience_feed_summaries.
15618 15619 15620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15618 def experience_feed_summaries @experience_feed_summaries end |
#feed_statistics_summary ⇒ Object (readonly)
Returns the value of attribute feed_statistics_summary.
15618 15619 15620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15618 def feed_statistics_summary @feed_statistics_summary end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
15618 15619 15620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15618 def id @id end |
#incoming_feed ⇒ Object (readonly)
Returns the value of attribute incoming_feed.
15618 15619 15620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15618 def incoming_feed @incoming_feed end |
#outgoing_feed ⇒ Object (readonly)
Returns the value of attribute outgoing_feed.
15618 15619 15620 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15618 def outgoing_feed @outgoing_feed end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15635 15636 15637 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15635 def copy(incoming={}) CatalogFeed.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
15639 15640 15641 15642 15643 15644 15645 15646 15647 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15639 def subtype_to_hash { :id => id, :experience_feed_summaries => experience_feed_summaries.map { |o| o.to_hash }, :incoming_feed => incoming_feed.to_hash, :outgoing_feed => outgoing_feed.to_hash, :feed_statistics_summary => feed_statistics_summary.to_hash } end |
#to_json ⇒ Object
15631 15632 15633 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15631 def to_json JSON.dump(to_hash) end |