Module: LazyResource::UrlGeneration

Extended by:
ActiveSupport::Concern
Included in:
Resource, ResourceQueue
Defined in:
lib/lazy_resource/url_generation.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#collection_path(options = nil) ⇒ Object



18
19
20
# File 'lib/lazy_resource/url_generation.rb', line 18

def collection_path(options = nil)
  self.class.collection_path(options)
end

#collection_url(options = nil) ⇒ Object



22
23
24
25
# File 'lib/lazy_resource/url_generation.rb', line 22

def collection_url(options = nil)
  url = self.class.site.to_s.gsub(/\/$/, '')
  url << self.collection_path(options)
end

#element_path(options = nil) ⇒ Object



5
6
7
# File 'lib/lazy_resource/url_generation.rb', line 5

def element_path(options = nil)
  self.class.element_path(self.primary_key, options)
end

#element_url(options = nil) ⇒ Object



9
10
11
12
# File 'lib/lazy_resource/url_generation.rb', line 9

def element_url(options = nil)
  url = self.class.site.to_s.gsub(/\/$/, '')
  url << self.element_path(options)
end

#new_element_pathObject



14
15
16
# File 'lib/lazy_resource/url_generation.rb', line 14

def new_element_path
  self.class.new_element_path
end

#split_options(options = {}) ⇒ Object



27
28
29
# File 'lib/lazy_resource/url_generation.rb', line 27

def split_options(options = {})
  self.class.split_options(options)
end