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.



25025
25026
25027
25028
25029
25030
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25025

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.



25023
25024
25025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25023

def delay
  @delay
end

#frequencyObject (readonly)

Returns the value of attribute frequency.



25023
25024
25025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25023

def frequency
  @frequency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25036
25037
25038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25036

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

#to_hashObject



25040
25041
25042
25043
25044
25045
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25040

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

#to_jsonObject



25032
25033
25034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25032

def to_json
  JSON.dump(to_hash)
end