Class: Io::Flow::V0::Models::IncomingFeed
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::IncomingFeed
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Describe a feed incoming to Flow
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#item_link ⇒ Object
readonly
Returns the value of attribute item_link.
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ IncomingFeed
constructor
A new instance of IncomingFeed.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ IncomingFeed
Returns a new instance of IncomingFeed.
27251 27252 27253 27254 27255 27256 27257 27258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27251 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:url, :format, :item_link], 'IncomingFeed') @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String) @format = (x = opts.delete(:format); x.is_a?(::Io::Flow::V0::Models::IncomingFeedFormat) ? x : ::Io::Flow::V0::Models::IncomingFeedFormat.apply(x)) @minute = HttpClient::Preconditions.assert_class('minute', (x = opts.delete(:minute); x.nil? ? 55 : x), Integer) @item_link = (x = opts.delete(:item_link); x.is_a?(::Io::Flow::V0::Models::ItemLink) ? x : ::Io::Flow::V0::Models::ItemLink.new(x)) end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
27249 27250 27251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27249 def format @format end |
#item_link ⇒ Object (readonly)
Returns the value of attribute item_link.
27249 27250 27251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27249 def item_link @item_link end |
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
27249 27250 27251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27249 def minute @minute end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
27249 27250 27251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27249 def url @url end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
27264 27265 27266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27264 def copy(incoming={}) IncomingFeed.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
27268 27269 27270 27271 27272 27273 27274 27275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27268 def to_hash { :url => url, :format => format.value, :minute => minute, :item_link => item_link.to_hash } end |
#to_json ⇒ Object
27260 27261 27262 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27260 def to_json JSON.dump(to_hash) end |