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

Returns a new instance of PhraseHintForm.



32798
32799
32800
32801
32802
32803
32804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32798

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.



32796
32797
32798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32796

def destination
  @destination
end

#phraseObject (readonly)

Returns the value of attribute phrase.



32796
32797
32798
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32796

def phrase
  @phrase
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32810
32811
32812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32810

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

#subtype_to_hashObject



32814
32815
32816
32817
32818
32819
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32814

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

#to_jsonObject



32806
32807
32808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32806

def to_json
  JSON.dump(to_hash)
end