Class: Io::Flow::V0::Models::LabelVersion
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LabelVersion
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#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 = {}) ⇒ LabelVersion
constructor
A new instance of LabelVersion.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LabelVersion
Returns a new instance of LabelVersion.
10949 10950 10951 10952 10953 10954 10955 10956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10949 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :label], 'LabelVersion') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) = 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)) @label = (x = opts.delete(:label); x.is_a?(::Io::Flow::V0::Models::LabelSummary) ? x : ::Io::Flow::V0::Models::LabelSummary.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
10947 10948 10949 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10947 def id @id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
10947 10948 10949 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10947 def label @label end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
10947 10948 10949 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10947 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10947 10948 10949 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10947 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
10962 10963 10964 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10962 def copy(incoming={}) LabelVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
10966 10967 10968 10969 10970 10971 10972 10973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10966 def to_hash { :id => id, :timestamp => , :type => type.value, :label => label.to_hash } end |
#to_json ⇒ Object
10958 10959 10960 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10958 def to_json JSON.dump(to_hash) end |