class FidorApi::Token

Constants

ATTRIBUTES

Public Class Methods

new(args = {}) click to toggle source
# File lib/fidor_api/token.rb, line 12
def initialize(args = {})
  args.each do |key, value|
    next unless ATTRIBUTES.include?(key.to_sym)

    instance_variable_set("@#{key}", value)
  end
end

Public Instance Methods

to_h() click to toggle source
# File lib/fidor_api/token.rb, line 20
def to_h
  Hash[ATTRIBUTES.map { |key| [key, instance_variable_get("@#{key}")] }]
end