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.



24006
24007
24008
24009
24010
24011
24012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24006

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.



24004
24005
24006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24004

def destination
  @destination
end

#phraseObject (readonly)

Returns the value of attribute phrase.



24004
24005
24006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24004

def phrase
  @phrase
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24018
24019
24020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24018

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

#subtype_to_hashObject



24022
24023
24024
24025
24026
24027
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24022

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

#to_jsonObject



24014
24015
24016
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24014

def to_json
  JSON.dump(to_hash)
end