Module: LoadaBoy
- Defined in:
- lib/loadaboy.rb
Class Method Summary collapse
Instance Method Summary collapse
- #generate_default ⇒ Object (also: #generate)
- #request(name, url, options = {}) ⇒ Object
Class Method Details
.generator(service = 'default', &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/loadaboy.rb', line 6 def generator(service = 'default', &block) define_method "generate_#{service}" do @urls = {} block.call @urls end end |
.set_generator(name) ⇒ Object
13 14 15 |
# File 'lib/loadaboy.rb', line 13 def set_generator(name) alias_method(:generate, "generate_#{name}") end |
Instance Method Details
#generate_default ⇒ Object Also known as: generate
22 23 24 25 26 |
# File 'lib/loadaboy.rb', line 22 def generate_default @urls = {} request :default, "/" @urls end |
#request(name, url, options = {}) ⇒ Object
18 19 20 |
# File 'lib/loadaboy.rb', line 18 def request(name, url, ={}) @urls[name] = url end |