Class: Io::Flow::V0::Models::OnboardingStateTransition

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OnboardingStateTransition

Returns a new instance of OnboardingStateTransition.



50899
50900
50901
50902
50903
50904
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50899

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:state, :started_at], 'OnboardingStateTransition')
  @state = (x = opts.delete(:state); x.is_a?(::Io::Flow::V0::Models::OnboardingState) ? x : ::Io::Flow::V0::Models::OnboardingState.from_json(x))
  @started_at = HttpClient::Preconditions.assert_class('started_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:started_at)), DateTime)
end

Instance Attribute Details

#started_atObject (readonly)

Returns the value of attribute started_at.



50897
50898
50899
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50897

def started_at
  @started_at
end

#stateObject (readonly)

Returns the value of attribute state.



50897
50898
50899
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50897

def state
  @state
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50910
50911
50912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50910

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

#to_hashObject



50914
50915
50916
50917
50918
50919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50914

def to_hash
  {
    :state => state.to_hash,
    :started_at => started_at
  }
end

#to_jsonObject



50906
50907
50908
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50906

def to_json
  JSON.dump(to_hash)
end