Module: ActiveResource::Extend::AddRelativePrefix::ClassMethods

Defined in:
lib/ares/add_relative_prefix.rb

Instance Method Summary collapse

Instance Method Details

#collection_path_with_relative_prefix(*args) ⇒ Object



44
45
46
# File 'lib/ares/add_relative_prefix.rb', line 44

def collection_path_with_relative_prefix(*args)
  self.relative_prefix + collection_path_without_relative_prefix(*args)
end

#custom_method_collection_url(*args) ⇒ Object



32
33
34
# File 'lib/ares/add_relative_prefix.rb', line 32

def custom_method_collection_url(*args)
  self.relative_prefix + super
end

#element_path_with_relative_prefix(*args) ⇒ Object



36
37
38
# File 'lib/ares/add_relative_prefix.rb', line 36

def element_path_with_relative_prefix(*args)
  self.relative_prefix + element_path_without_relative_prefix(*args)
end

#new_element_path_with_relative_prefix(*args) ⇒ Object



40
41
42
# File 'lib/ares/add_relative_prefix.rb', line 40

def new_element_path_with_relative_prefix(*args)
  self.relative_prefix + new_element_path_without_relative_prefix(*args)
end

#relative_prefixObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/ares/add_relative_prefix.rb', line 17

def relative_prefix
  # Not using superclass_delegating_reader. See +site+ for explanation
  if defined?(@relative_prefix)
    @relative_prefix
  elsif superclass != Object && superclass.relative_prefix
    superclass.relative_prefix.dup.freeze
  else
    ""
  end
end

#relative_prefix=(relative_prefix) ⇒ Object



28
29
30
# File 'lib/ares/add_relative_prefix.rb', line 28

def relative_prefix=(relative_prefix)
  @relative_prefix = relative_prefix
end