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

Returns a new instance of TokenValidation.



18831
18832
18833
18834
18835
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18831

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.



18829
18830
18831
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18829

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18841
18842
18843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18841

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

#to_hashObject



18845
18846
18847
18848
18849
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18845

def to_hash
  {
    :status => status
  }
end

#to_jsonObject



18837
18838
18839
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18837

def to_json
  JSON.dump(to_hash)
end