Module: Restfulie::Client::Base
- Defined in:
- lib/restfulie/client/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/restfulie/client/base.rb', line 5
def method_missing(sym, *args, &block)
if @base_position.respond_to?(sym)
@base_position.send sym, *args, &block
else
super(sym, *args, &block)
end
end
|
Class Method Details
.included(base) ⇒ Object
13
14
15
|
# File 'lib/restfulie/client/base.rb', line 13
def self.included(base) base.extend(self)
end
|
Instance Method Details
22
23
24
25
26
27
28
29
|
# File 'lib/restfulie/client/base.rb', line 22
def configure
configuration = EntryPoint.configuration_of(resource_name)
raise "Undefined configuration for #{resource_name}" unless configuration
@base_position = Restfulie.at(configuration.entry_point)
configuration.representations.each do |representation_name,representation|
register_representation(representation_name,representation)
end
end
|
#resource_name ⇒ Object
31
32
33
|
# File 'lib/restfulie/client/base.rb', line 31
def resource_name
@resource_name ||= self.class.to_s.to_sym
end
|
#uses_restfulie(configuration = Configuration.new, &block) ⇒ Object