Class: Io::Flow::V0::Models::PhraseHintForm

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

Instance Attribute Summary collapse

Attributes inherited from HintForm

#discriminator

Instance Method Summary collapse

Methods inherited from HintForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PhraseHintForm



23790
23791
23792
23793
23794
23795
23796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23790

def initialize(incoming={})
  super(:discriminator => HintForm::Types::PHRASE_HINT_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:phrase, :destination], 'PhraseHintForm')
  @phrase = HttpClient::Preconditions.assert_class('phrase', opts.delete(:phrase), String)
  @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String)
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



23788
23789
23790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23788

def destination
  @destination
end

#phraseObject (readonly)

Returns the value of attribute phrase.



23788
23789
23790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23788

def phrase
  @phrase
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



23802
23803
23804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23802

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

#subtype_to_hashObject



23806
23807
23808
23809
23810
23811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23806

def subtype_to_hash
  {
    :phrase => phrase,
    :destination => destination
  }
end

#to_jsonObject



23798
23799
23800
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23798

def to_json
  JSON.dump(to_hash)
end