Class: Io::Flow::V0::Models::TokenValidation

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

Overview

Model used to report whether or not a given token is valid

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TokenValidation



51021
51022
51023
51024
51025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51021

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:status], 'TokenValidation')
  @status = HttpClient::Preconditions.assert_class('status', opts.delete(:status), String)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



51019
51020
51021
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51019

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51031
51032
51033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51031

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

#to_hashObject



51035
51036
51037
51038
51039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51035

def to_hash
  {
    :status => status
  }
end

#to_jsonObject



51027
51028
51029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51027

def to_json
  JSON.dump(to_hash)
end