Module: Rooftop::Base::ClassMethods
- Defined in:
- lib/rooftop/base.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#api_namespace ⇒ Object
Returns the value of attribute api_namespace.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
Instance Method Summary collapse
-
#first ⇒ Object
Allow calling ‘first’.
- #reload! ⇒ Object
- #setup_path! ⇒ Object
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
57 58 59 |
# File 'lib/rooftop/base.rb', line 57 def api_endpoint @api_endpoint end |
#api_namespace ⇒ Object
Returns the value of attribute api_namespace.
57 58 59 |
# File 'lib/rooftop/base.rb', line 57 def api_namespace @api_namespace end |
#api_version ⇒ Object
Returns the value of attribute api_version.
57 58 59 |
# File 'lib/rooftop/base.rb', line 57 def api_version @api_version end |
Instance Method Details
#first ⇒ Object
Allow calling ‘first’
80 81 82 |
# File 'lib/rooftop/base.rb', line 80 def first all.first end |
#reload! ⇒ Object
84 85 86 |
# File 'lib/rooftop/base.rb', line 84 def reload! self.class.find(self.id) if self.id end |
#setup_path! ⇒ Object
74 75 76 77 |
# File 'lib/rooftop/base.rb', line 74 def setup_path! @api_endpoint ||= collection_path self.collection_path "#{@api_namespace}/v#{@api_version}/#{@api_endpoint}" end |