Method: ApRubySdk::Collection#attributes=

Defined in:
lib/ap_ruby_sdk/collection.rb

#attributes=(attributes) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ap_ruby_sdk/collection.rb', line 14

def attributes=(attributes)
  if attributes.respond_to?(:each)
    attributes.each do |key, value|
      writer = (key == 'type' ? 'kind=' : "#{key}=")
      if respond_to?(writer)
        send(writer, value)
      end
    end
  else
    attributes
  end
end