class Moniker::Common
Public Class Methods
collection_path(prefix_options = {}, query_options = nil)
click to toggle source
Overrides ActiveResource::Base::collection_path to remove .<extension> from resources path
# File lib/moniker/common.rb, line 29 def self.collection_path(prefix_options = {}, query_options = nil) check_prefix_options(prefix_options) prefix_options, query_options = split_options(prefix_options) if query_options.nil? "#{prefix(prefix_options)}#{collection_name}#{query_string(query_options)}" end
custom_method_collection_url(method_name, options = {})
click to toggle source
Overrides ActiveResource::CustomMethods to remove .<extension>
# File lib/moniker/common.rb, line 37 def self.custom_method_collection_url(method_name, options = {}) prefix_options, query_options = split_options(options) "#{prefix(prefix_options)}#{collection_name}/#{method_name}#{query_string(query_options)}" end
element_path(id, prefix_options = {}, query_options = nil)
click to toggle source
Overrides ActiveResource::Base::element_path to remove .<extension> from resources path
# File lib/moniker/common.rb, line 21 def self.element_path(id, prefix_options = {}, query_options = nil) check_prefix_options(prefix_options) prefix_options, query_options = split_options(prefix_options) if query_options.nil? "#{prefix(prefix_options)}#{collection_name}/#{URI.parser.escape id.to_s}#{query_string(query_options)}" end
Private Instance Methods
custom_method_element_url(method_name, options = {})
click to toggle source
# File lib/moniker/common.rb, line 44 def custom_method_element_url(method_name, options = {}) "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/#{id}/#{method_name}#{self.class.__send__(:query_string, options)}" end
custom_method_new_element_url(method_name, options = {})
click to toggle source
# File lib/moniker/common.rb, line 48 def custom_method_new_element_url(method_name, options = {}) "#{self.class.prefix(prefix_options)}#{self.class.collection_name}/new/#{method_name}#{self.class.__send__(:query_string, options)}" end