Class: Io::Flow::V0::Models::PriceBookItemSchedule

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Represents schedule applied to a price book item

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PriceBookItemSchedule

Returns a new instance of PriceBookItemSchedule.



32830
32831
32832
32833
32834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32830

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @starts_at = (x = opts.delete(:starts_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('starts_at', HttpClient::Helper.to_date_time_iso8601(x), 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_atObject (readonly)

Returns the value of attribute ends_at.



32828
32829
32830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32828

def ends_at
  @ends_at
end

#starts_atObject (readonly)

Returns the value of attribute starts_at.



32828
32829
32830
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32828

def starts_at
  @starts_at
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32840
32841
32842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32840

def copy(incoming={})
  PriceBookItemSchedule.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



32844
32845
32846
32847
32848
32849
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32844

def to_hash
  {
    :starts_at => starts_at,
    :ends_at => ends_at
  }
end

#to_jsonObject



32836
32837
32838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32836

def to_json
  JSON.dump(to_hash)
end