lib/sorenson/services/group.rb in 360_services-0.0.5 vs lib/sorenson/services/group.rb in 360_services-0.0.6

- old
+ new

@@ -1,11 +1,22 @@ module Sorenson module Services class Group < Base attr_accessor :name, :description, :account_id, :id, :guid + def self.presets(group_id) + get_from("/groups/#{group_id}/presets") + end + def self.create(name, attributes={}) data = post_to("/groups", :group => attributes.merge(:name => name)) + new(data['group']) + end + + def self.update(name, attributes={}) + attributes[:preset_ids] = attributes[:preset_ids].join(",") + guid = attributes.delete(:group_id) + data = put_to("/groups/#{guid}", :group => attributes.merge({:name => name, :id => guid})) new(data['group']) end def self.all collection = Base.get_from("/groups") \ No newline at end of file