Module: Cut::ClassMethods
- Defined in:
- lib/cut/class_methods.rb
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
- #map(*args) ⇒ Object
- #selector(new_selector) ⇒ Object
- #url(new_url) ⇒ Object
Instance Method Details
#all(options = {}) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/cut/class_methods.rb', line 16 def all( = {}) endpoint = @@url.dup .each {|key,value| endpoint.gsub!("{{#{key}}}", CGI.escape(value)) } response = Client.get(endpoint) parse(response) end |
#map(*args) ⇒ Object
12 13 14 |
# File 'lib/cut/class_methods.rb', line 12 def map(*args) add_mapping(*args) end |
#selector(new_selector) ⇒ Object
8 9 10 |
# File 'lib/cut/class_methods.rb', line 8 def selector(new_selector) @@selector = new_selector end |
#url(new_url) ⇒ Object
4 5 6 |
# File 'lib/cut/class_methods.rb', line 4 def url(new_url) @@url = new_url end |