Class: Io::Flow::V0::Models::DatetimeWithTimezone
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DatetimeWithTimezone
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#datetime ⇒ Object
readonly
Returns the value of attribute datetime.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DatetimeWithTimezone
constructor
A new instance of DatetimeWithTimezone.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ DatetimeWithTimezone
Returns a new instance of DatetimeWithTimezone.
29760 29761 29762 29763 29764 29765 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29760 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:datetime, :timezone], 'DatetimeWithTimezone') @datetime = HttpClient::Preconditions.assert_class('datetime', HttpClient::Helper.to_date_time_iso8601(opts.delete(:datetime)), DateTime) @timezone = HttpClient::Preconditions.assert_class('timezone', opts.delete(:timezone), String) end |
Instance Attribute Details
#datetime ⇒ Object (readonly)
Returns the value of attribute datetime.
29758 29759 29760 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29758 def datetime @datetime end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
29758 29759 29760 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29758 def timezone @timezone end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
29771 29772 29773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29771 def copy(incoming={}) DatetimeWithTimezone.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
29775 29776 29777 29778 29779 29780 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29775 def to_hash { :datetime => datetime, :timezone => timezone } end |
#to_json ⇒ Object
29767 29768 29769 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29767 def to_json JSON.dump(to_hash) end |