Class: OpenStack::Common

Inherits:
Base show all
Defined in:
lib/open_stack/common.rb

Class Method Summary collapse

Methods inherited from Base

headers

Methods inherited from ActiveResource::Base

#load

Class Method Details

.collection_path(prefix_options = {}, query_options = nil) ⇒ Object

Overrides ActiveResource::Base::collection_path to remove .<extension> from resources path



31
32
33
34
35
36
# File 'lib/open_stack/common.rb', line 31

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 = {}) ⇒ Object

Overrides ActiveResource::CustomMethods to remove .<extension>



39
40
41
42
# File 'lib/open_stack/common.rb', line 39

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) ⇒ Object

Overrides ActiveResource::Base::element_path to remove .<extension> from resources path



23
24
25
26
27
28
# File 'lib/open_stack/common.rb', line 23

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