Class: OctopusAuth::Decorators::Default

Inherits:
Object
  • Object
show all
Defined in:
lib/octopus_auth/decorators/default.rb

Instance Method Summary collapse

Constructor Details

#initialize(token_model) ⇒ Default

Returns a new instance of Default.



4
5
6
# File 'lib/octopus_auth/decorators/default.rb', line 4

def initialize(token_model)
  @token_model = token_model
end

Instance Method Details

#to_hObject Also known as: to_hash



14
15
16
17
18
19
20
# File 'lib/octopus_auth/decorators/default.rb', line 14

def to_h
  OctopusAuth::Decorators::ATTRIBUTES.inject({}) do |carry, item|
    carry[item] = @token_model.send(item)

    carry
  end
end