Class: Io::Flow::V0::Models::CenterForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CenterForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#capabilities ⇒ Object
readonly
Returns the value of attribute capabilities.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#packaging ⇒ Object
readonly
Returns the value of attribute packaging.
-
#partner_center_form ⇒ Object
readonly
Returns the value of attribute partner_center_form.
-
#schedule ⇒ Object
readonly
Returns the value of attribute schedule.
-
#services ⇒ Object
readonly
Returns the value of attribute services.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CenterForm
constructor
A new instance of CenterForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CenterForm
Returns a new instance of CenterForm.
17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17002 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:address, :packaging, :name, :services, :schedule], 'CenterForm') @address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x)) @packaging = HttpClient::Preconditions.assert_class('packaging', opts.delete(:packaging), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Packaging) ? x : ::Io::Flow::V0::Models::Packaging.new(x)) } @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @services = HttpClient::Preconditions.assert_class('services', opts.delete(:services), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AvailableService) ? x : ::Io::Flow::V0::Models::AvailableService.new(x)) } @schedule = (x = opts.delete(:schedule); x.is_a?(::Io::Flow::V0::Models::Schedule) ? x : ::Io::Flow::V0::Models::Schedule.new(x)) @timezone = (x = opts.delete(:timezone); x.nil? ? nil : HttpClient::Preconditions.assert_class('timezone', x, String)) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @capabilities = (x = opts.delete(:capabilities); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CenterCapabilities) ? x : ::Io::Flow::V0::Models::CenterCapabilities.new(x))) @partner_center_form = (x = opts.delete(:partner_center_form); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PartnerCenterForm) ? x : ::Io::Flow::V0::Models::PartnerCenterForm.new(x))) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def address @address end |
#capabilities ⇒ Object (readonly)
Returns the value of attribute capabilities.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def capabilities @capabilities end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def name @name end |
#packaging ⇒ Object (readonly)
Returns the value of attribute packaging.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def packaging @packaging end |
#partner_center_form ⇒ Object (readonly)
Returns the value of attribute partner_center_form.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def partner_center_form @partner_center_form end |
#schedule ⇒ Object (readonly)
Returns the value of attribute schedule.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def schedule @schedule end |
#services ⇒ Object (readonly)
Returns the value of attribute services.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def services @services end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
17000 17001 17002 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17000 def timezone @timezone end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17020 17021 17022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17020 def copy(incoming={}) CenterForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17024 def to_hash { :address => address.to_hash, :packaging => packaging.map { |o| o.to_hash }, :name => name, :services => services.map { |o| o.to_hash }, :schedule => schedule.to_hash, :timezone => timezone, :key => key, :capabilities => capabilities.nil? ? nil : capabilities.to_hash, :partner_center_form => partner_center_form.nil? ? nil : partner_center_form.to_hash } end |
#to_json ⇒ Object
17016 17017 17018 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17016 def to_json JSON.dump(to_hash) end |