Class: RubyRedtail::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-redtail/authentication.rb

Instance Method Summary collapse

Constructor Details

#initialize(authentication = {}) ⇒ Authentication

Returns a new instance of Authentication.

Raises:

  • (ArgumentError)


3
4
5
6
7
8
9
10
# File 'lib/ruby-redtail/authentication.rb', line 3

def initialize(authentication = {})
  raise ArgumentError if authentication.class != Hash
  authentication.each do |key, value|
    key = key.underscore
    self.class.send :attr_accessor, key
    instance_variable_set "@#{key}", value
  end
end