Module: Starwars::Fetcher::ClassMethods
- Defined in:
- lib/starwars/fetcher.rb
Overview
Fetcher Class Method to be included in every resource
Instance Method Summary collapse
Instance Method Details
#fetch(id) ⇒ Object
30 31 32 |
# File 'lib/starwars/fetcher.rb', line 30 def fetch(id) super(resouces_name, id) end |
#resouces_name ⇒ Object
34 35 36 37 |
# File 'lib/starwars/fetcher.rb', line 34 def resouces_name resource = name.split('::').last.downcase (resource == 'person') ? 'people' : "#{resource}s" end |