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.



28689
28690
28691
28692
28693
28694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28689

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.



28687
28688
28689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28687

def delay
  @delay
end

#frequencyObject (readonly)

Returns the value of attribute frequency.



28687
28688
28689
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28687

def frequency
  @frequency
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28700
28701
28702
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28700

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

#to_hashObject



28704
28705
28706
28707
28708
28709
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28704

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

#to_jsonObject



28696
28697
28698
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28696

def to_json
  JSON.dump(to_hash)
end