Class: Io::Flow::V0::Models::RepeatHourly

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 = {}) ⇒ RepeatHourly



56438
56439
56440
56441
56442
56443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56438

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

Instance Attribute Details

#intervalObject (readonly)

Returns the value of attribute interval.



56436
56437
56438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56436

def interval
  @interval
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56449
56450
56451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56449

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

#subtype_to_hashObject



56453
56454
56455
56456
56457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56453

def subtype_to_hash
  {
    :interval => interval
  }
end

#to_jsonObject



56445
56446
56447
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56445

def to_json
  JSON.dump(to_hash)
end