Class: Outbrain::Api::Relation

Inherits:
OpenStruct
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/outbrain/api/relation.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Relation

Returns a new instance of Relation.



7
8
9
10
11
12
13
# File 'lib/outbrain/api/relation.rb', line 7

def initialize(options = {})
  super
  self.errors = []
  relation = options.delete(options[:relation_name])
  Hashie::Mash.new(options).each{ |k,v| self[k] = v }
  setup_relations(relation)
end