Class: Io::Flow::V0::Models::RatecardLaneVersion
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RatecardLaneVersion
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ratecard_lane ⇒ Object
readonly
Returns the value of attribute ratecard_lane.
-
#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 = {}) ⇒ RatecardLaneVersion
constructor
A new instance of RatecardLaneVersion.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ RatecardLaneVersion
Returns a new instance of RatecardLaneVersion.
62399 62400 62401 62402 62403 62404 62405 62406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62399 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :ratecard_lane], 'RatecardLaneVersion') @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)) @ratecard_lane = (x = opts.delete(:ratecard_lane); x.is_a?(::Io::Flow::V0::Models::RatecardLane) ? x : ::Io::Flow::V0::Models::RatecardLane.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
62397 62398 62399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62397 def id @id end |
#ratecard_lane ⇒ Object (readonly)
Returns the value of attribute ratecard_lane.
62397 62398 62399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62397 def ratecard_lane @ratecard_lane end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
62397 62398 62399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62397 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
62397 62398 62399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62397 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
62412 62413 62414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62412 def copy(incoming={}) RatecardLaneVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
62416 62417 62418 62419 62420 62421 62422 62423 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62416 def to_hash { :id => id, :timestamp => , :type => type.value, :ratecard_lane => ratecard_lane.to_hash } end |
#to_json ⇒ Object
62408 62409 62410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62408 def to_json JSON.dump(to_hash) end |