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.



56411
56412
56413
56414
56415
56416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56411

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.



56409
56410
56411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56409

def interval
  @interval
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56422
56423
56424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56422

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

#subtype_to_hashObject



56426
56427
56428
56429
56430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56426

def subtype_to_hash
  {
    :interval => interval
  }
end

#to_jsonObject



56418
56419
56420
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56418

def to_json
  JSON.dump(to_hash)
end