Class: Io::Flow::V0::Models::OutgoingFeed

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

Overview

Describes the outgoing feed constructed by Flow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OutgoingFeed

Returns a new instance of OutgoingFeed.



26786
26787
26788
26789
26790
26791
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26786

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:format], 'OutgoingFeed')
  @format = (x = opts.delete(:format); x.is_a?(::Io::Flow::V0::Models::OutgoingFeedFormat) ? x : ::Io::Flow::V0::Models::OutgoingFeedFormat.apply(x))
  @minute = HttpClient::Preconditions.assert_class('minute', (x = opts.delete(:minute); x.nil? ? 0 : x), Integer)
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



26784
26785
26786
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26784

def format
  @format
end

#minuteObject (readonly)

Returns the value of attribute minute.



26784
26785
26786
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26784

def minute
  @minute
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26797
26798
26799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26797

def copy(incoming={})
  OutgoingFeed.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



26801
26802
26803
26804
26805
26806
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26801

def to_hash
  {
    :format => format.value,
    :minute => minute
  }
end

#to_jsonObject



26793
26794
26795
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26793

def to_json
  JSON.dump(to_hash)
end