class Beaver::Token

Token Model.

Attributes

id[RW]

TODO: Write general description for this method @return [String]

permissioned_fields[RW]

TODO: Write general description for this method @return [List of String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/token.rb, line 32
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  permissioned_fields = hash['permissioned_fields']

  # Create object from extracted values.
  Token.new(id,
            permissioned_fields)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/token.rb, line 18
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['permissioned_fields'] = 'permissioned_fields'
  @_hash
end
new(id = nil, permissioned_fields = nil) click to toggle source
# File lib/beaver/models/token.rb, line 25
def initialize(id = nil,
               permissioned_fields = nil)
  @id = id
  @permissioned_fields = permissioned_fields
end