Class: Io::Flow::V0::Models::ReturnPolicyVersion
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnPolicyVersion
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#return_policy ⇒ Object
readonly
Returns the value of attribute return_policy.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReturnPolicyVersion
constructor
A new instance of ReturnPolicyVersion.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReturnPolicyVersion
Returns a new instance of ReturnPolicyVersion.
64305 64306 64307 64308 64309 64310 64311 64312 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64305 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :return_policy], 'ReturnPolicyVersion') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x)) @return_policy = (x = opts.delete(:return_policy); x.is_a?(::Io::Flow::V0::Models::ReturnPolicy) ? x : ::Io::Flow::V0::Models::ReturnPolicy.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
64303 64304 64305 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64303 def id @id end |
#return_policy ⇒ Object (readonly)
Returns the value of attribute return_policy.
64303 64304 64305 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64303 def return_policy @return_policy end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
64303 64304 64305 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64303 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
64303 64304 64305 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64303 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
64318 64319 64320 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64318 def copy(incoming={}) ReturnPolicyVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
64322 64323 64324 64325 64326 64327 64328 64329 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64322 def to_hash { :id => id, :timestamp => , :type => type.value, :return_policy => return_policy.to_hash } end |
#to_json ⇒ Object
64314 64315 64316 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64314 def to_json JSON.dump(to_hash) end |