Class: Imgurapi::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/imgurapi/models/base.rb

Direct Known Subclasses

Account, Image

Instance Method Summary collapse

Constructor Details

#initialize(hsh = {}) ⇒ Base

Returns a new instance of Base.



3
4
5
6
7
8
9
10
# File 'lib/imgurapi/models/base.rb', line 3

def initialize(hsh = {})
  hsh.each do |k, v|
    singleton_class.class_eval do
      attr_accessor k
    end
    send("#{k}=", v)
  end
end