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

Returns a new instance of RepeatHourly.



46292
46293
46294
46295
46296
46297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46292

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.



46290
46291
46292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46290

def interval
  @interval
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46303
46304
46305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46303

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

#subtype_to_hashObject



46307
46308
46309
46310
46311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46307

def subtype_to_hash
  {
    :interval => interval
  }
end

#to_jsonObject



46299
46300
46301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46299

def to_json
  JSON.dump(to_hash)
end