Module: Axel::ServiceResource::AutomaticResource::ClassMethods
- Defined in:
- app/models/axel/service_resource/automatic_resource.rb
Instance Method Summary collapse
-
#resource ⇒ Object
Resource object that holds configuration information about the service and path.
-
#resource_name(name = nil) ⇒ Object
Name the resource.
Instance Method Details
#resource ⇒ Object
Resource object that holds configuration information about the service and path
17 18 19 |
# File 'app/models/axel/service_resource/automatic_resource.rb', line 17 def resource Axel.resources[resource_name] end |
#resource_name(name = nil) ⇒ Object
Name the resource. Used if you call your class Foo but the API Proxy know it as “Bar”. This will resolve that configuration disconnect
10 11 12 13 |
# File 'app/models/axel/service_resource/automatic_resource.rb', line 10 def resource_name(name = nil) @_resource_name = name.to_s.underscore.pluralize if name @_resource_name || self.name.split("::").last.underscore.pluralize end |