Module: Rapidash::Resourceable
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/rapidash/resourceable.rb', line 3 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#resource(name, id = nil, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/rapidash/resourceable.rb', line 7 def resource(name, id = nil, = {}) [:url] ||= name if self.respond_to?(:url) = {:previous_url => self.url}.merge!() end client = self client = self.client if self.respond_to?(:client) Rapidash::Base.new(client, id, ) end |
#resource!(*args) ⇒ Object
17 18 19 |
# File 'lib/rapidash/resourceable.rb', line 17 def resource!(*args) self.resource(*args).call! end |