Class: Io::Flow::V0::Models::AbandonedOrderEmailSettings

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ AbandonedOrderEmailSettings

Returns a new instance of AbandonedOrderEmailSettings.



21578
21579
21580
21581
21582
21583
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21578

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:delay, :frequency], 'AbandonedOrderEmailSettings')
  @delay = (x = opts.delete(:delay); x.is_a?(::Io::Flow::V0::Models::Duration) ? x : ::Io::Flow::V0::Models::Duration.new(x))
  @frequency = (x = opts.delete(:frequency); x.is_a?(::Io::Flow::V0::Models::Duration) ? x : ::Io::Flow::V0::Models::Duration.new(x))
end

Instance Attribute Details

#delayObject (readonly)

Returns the value of attribute delay.



21576
21577
21578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21576

def delay
  @delay
end

#frequencyObject (readonly)

Returns the value of attribute frequency.



21576
21577
21578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21576

def frequency
  @frequency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21589
21590
21591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21589

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

#to_hashObject



21593
21594
21595
21596
21597
21598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21593

def to_hash
  {
    :delay => delay.to_hash,
    :frequency => frequency.to_hash
  }
end

#to_jsonObject



21585
21586
21587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21585

def to_json
  JSON.dump(to_hash)
end