Class: BacklogKit::Resource

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

Instance Method Summary collapse

Constructor Details

#initialize(raw_data = {}) ⇒ Resource

Returns a new instance of Resource.



3
4
5
6
7
8
9
10
11
12
# File 'lib/backlog_kit/resource.rb', line 3

def initialize(raw_data = {})
  @attributes = {}

  raw_data.each do |key, value|
    @attributes[key.to_sym] = process_value(value)
  end

  eigenclass = class << self; self; end
  eigenclass.send(:define_accessors, raw_data.keys)
end