Class: Io::Flow::V0::Models::RepeatDaily

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

Instance Attribute Summary collapse

Attributes inherited from RepeatSchedule

#discriminator

Instance Method Summary collapse

Methods inherited from RepeatSchedule

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ RepeatDaily

Returns a new instance of RepeatDaily.



48854
48855
48856
48857
48858
48859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48854

def initialize(incoming={})
  super(:discriminator => RepeatSchedule::Types::REPEAT_DAILY)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:interval], 'RepeatDaily')
  @interval = HttpClient::Preconditions.assert_class('interval', opts.delete(:interval), Integer)
end

Instance Attribute Details

#intervalObject (readonly)

Returns the value of attribute interval.



48852
48853
48854
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48852

def interval
  @interval
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



48865
48866
48867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48865

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

#subtype_to_hashObject



48869
48870
48871
48872
48873
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48869

def subtype_to_hash
  {
    :interval => interval
  }
end

#to_jsonObject



48861
48862
48863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48861

def to_json
  JSON.dump(to_hash)
end