Class: Passfort::Resource::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/passfort/resource/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Base

Returns a new instance of Base.



12
13
14
# File 'lib/passfort/resource/base.rb', line 12

def initialize(attributes)
  @attributes = attributes.with_indifferent_access
end

Class Method Details

.attributes(*keys) ⇒ Object



8
9
10
# File 'lib/passfort/resource/base.rb', line 8

def self.attributes(*keys)
  keys.each { |key| define_method(key) { @attributes[key] } }
end

Instance Method Details

#to_hObject



16
17
18
# File 'lib/passfort/resource/base.rb', line 16

def to_h
  @attributes
end