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.



58923
58924
58925
58926
58927
58928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58923

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.



58921
58922
58923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58921

def interval
  @interval
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58934
58935
58936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58934

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

#subtype_to_hashObject



58938
58939
58940
58941
58942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58938

def subtype_to_hash
  {
    :interval => interval
  }
end

#to_jsonObject



58930
58931
58932
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58930

def to_json
  JSON.dump(to_hash)
end