lib/runcible/resources/consumer.rb in runcible-0.1.1 vs lib/runcible/resources/consumer.rb in runcible-0.1.2
- old
+ new
@@ -38,14 +38,14 @@
def self.retrieve(id)
call(:get, path(id))
end
def self.update(id, optional={})
- required = required_params(binding.send(:local_variables), binding)
- call(:put, path(id), :payload => { :required => required, :optional => optional })
+ call(:put, path(id), :payload => { :delta => optional })
end
+
def self.upload_profile(id, content_type, profile)
required = required_params(binding.send(:local_variables), binding, ["id"])
call(:post, path("#{id}/profiles/"), :payload => { :required => required })
end
@@ -55,10 +55,19 @@
def self.delete(id)
call(:delete, path(id))
end
+ def self.retrieve_binding(id, repo_id, distributor_id)
+ call(:get, path("#{id}/bindings/#{repo_id}/#{distributor_id}"))
+ end
+
+ def self.retrieve_bindings(id)
+ call(:get, path("#{id}/bindings/"))
+ end
+
+
def self.bind(id, repo_id, distributor_id)
required = required_params(binding.send(:local_variables), binding, ["id"])
call(:post, path("#{id}/bindings"), :payload => { :required => required })
end
@@ -68,20 +77,20 @@
def self.repos(id)
call(:get, path("#{id}/bindings/"))
end
- def self.install_content(id, units, options="")
+ def self.install_units(id, units, options="")
required = required_params(binding.send(:local_variables), binding, ["id"])
call(:post, path("#{id}/actions/content/install/"), :payload => { :required => required })
end
- def self.update_content(id, units, options="")
+ def self.update_units(id, units, options="")
required = required_params(binding.send(:local_variables), binding, ["id"])
call(:post, path("#{id}/actions/content/update/"), :payload => { :required => required })
end
- def self.uninstall_content(id, units, options="")
+ def self.uninstall_units(id, units, options="")
required = required_params(binding.send(:local_variables), binding, ["id"])
call(:post, path("#{id}/actions/content/uninstall/"), :payload => { :required => required })
end
end
end
\ No newline at end of file