Class: WebFixtures::DSL
- Inherits:
-
Object
- Object
- WebFixtures::DSL
- Defined in:
- lib/web_fixtures/dsl.rb
Constant Summary collapse
- @@default_options =
{ :include_headers => true, :authenticate => false, :root_path => "./fixtures" }
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#default_options ⇒ Object
Returns the value of attribute default_options.
Instance Method Summary collapse
- #authenticate(choice) ⇒ Object
- #delete(url, options = {}) ⇒ Object
- #get(url, options = {}) ⇒ Object
- #include_headers(choice) ⇒ Object
-
#initialize(base, options = {}) ⇒ DSL
constructor
A new instance of DSL.
- #post(url, options = {}) ⇒ Object
- #put(url, options = {}) ⇒ Object
- #storage_path(path) ⇒ Object
Constructor Details
#initialize(base, options = {}) ⇒ DSL
Returns a new instance of DSL.
13 14 15 16 |
# File 'lib/web_fixtures/dsl.rb', line 13 def initialize(base, = {}) @base = base @default_options = @@default_options.merge() end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
4 5 6 |
# File 'lib/web_fixtures/dsl.rb', line 4 def base @base end |
#default_options ⇒ Object
Returns the value of attribute default_options.
5 6 7 |
# File 'lib/web_fixtures/dsl.rb', line 5 def @default_options end |
Instance Method Details
#authenticate(choice) ⇒ Object
22 23 24 |
# File 'lib/web_fixtures/dsl.rb', line 22 def authenticate(choice) [:authenticate] = choice end |
#delete(url, options = {}) ⇒ Object
42 43 44 |
# File 'lib/web_fixtures/dsl.rb', line 42 def delete(url, = {}) add_request(:delete, url, ) end |
#get(url, options = {}) ⇒ Object
30 31 32 |
# File 'lib/web_fixtures/dsl.rb', line 30 def get(url, = {}) add_request(:get, url, ) end |
#include_headers(choice) ⇒ Object
18 19 20 |
# File 'lib/web_fixtures/dsl.rb', line 18 def include_headers(choice) [:include_headers] = choice end |
#post(url, options = {}) ⇒ Object
34 35 36 |
# File 'lib/web_fixtures/dsl.rb', line 34 def post(url, = {}) add_request(:post, url, ) end |
#put(url, options = {}) ⇒ Object
38 39 40 |
# File 'lib/web_fixtures/dsl.rb', line 38 def put(url, = {}) add_request(:put, url, ) end |
#storage_path(path) ⇒ Object
26 27 28 |
# File 'lib/web_fixtures/dsl.rb', line 26 def storage_path(path) [:root_path] = path end |