module Rooftop::Base::ClassMethods
Attributes
api_endpoint[R]
api_namespace[R]
api_version[R]
Public Instance Methods
api_endpoint=(e)
click to toggle source
# File lib/rooftop/base.rb, line 69 def api_endpoint=(e) @api_endpoint = e setup_path! end
api_namespace=(ns)
click to toggle source
# File lib/rooftop/base.rb, line 59 def api_namespace=(ns) @api_namespace = ns setup_path! end
api_version=(v)
click to toggle source
# File lib/rooftop/base.rb, line 64 def api_version=(v) @api_version = v setup_path! end
first()
click to toggle source
Allow calling 'first'
# File lib/rooftop/base.rb, line 80 def first all.first end
reload!()
click to toggle source
# File lib/rooftop/base.rb, line 84 def reload! self.class.find(self.id) if self.id end
setup_path!()
click to toggle source
# 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