Class: Io::Flow::V0::Models::PriceBookItemSchedule
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceBookItemSchedule
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents schedule applied to a price book item
Instance Attribute Summary collapse
-
#ends_at ⇒ Object
readonly
Returns the value of attribute ends_at.
-
#starts_at ⇒ Object
readonly
Returns the value of attribute starts_at.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PriceBookItemSchedule
constructor
A new instance of PriceBookItemSchedule.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PriceBookItemSchedule
Returns a new instance of PriceBookItemSchedule.
60155 60156 60157 60158 60159 60160 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60155 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:starts_at], 'PriceBookItemSchedule') @starts_at = HttpClient::Preconditions.assert_class('starts_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:starts_at)), DateTime) @ends_at = (x = opts.delete(:ends_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('ends_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) end |
Instance Attribute Details
#ends_at ⇒ Object (readonly)
Returns the value of attribute ends_at.
60153 60154 60155 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60153 def ends_at @ends_at end |
#starts_at ⇒ Object (readonly)
Returns the value of attribute starts_at.
60153 60154 60155 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60153 def starts_at @starts_at end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
60166 60167 60168 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60166 def copy(incoming={}) PriceBookItemSchedule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
60170 60171 60172 60173 60174 60175 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60170 def to_hash { :starts_at => starts_at, :ends_at => ends_at } end |
#to_json ⇒ Object
60162 60163 60164 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 60162 def to_json JSON.dump(to_hash) end |