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.



63614
63615
63616
63617
63618
63619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63614

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.



63612
63613
63614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63612

def interval
  @interval
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



63625
63626
63627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63625

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

#subtype_to_hashObject



63629
63630
63631
63632
63633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63629

def subtype_to_hash
  {
    :interval => interval
  }
end

#to_jsonObject



63621
63622
63623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63621

def to_json
  JSON.dump(to_hash)
end