Class: SomeFixtures::Fixture
- Inherits:
-
Object
- Object
- SomeFixtures::Fixture
- Defined in:
- lib/somefixtures/fixture.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#fixtures ⇒ Object
Returns the value of attribute fixtures.
-
#format ⇒ Object
Returns the value of attribute format.
-
#login ⇒ Object
Returns the value of attribute login.
-
#save_to ⇒ Object
Returns the value of attribute save_to.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #add_get(*args) ⇒ Object
- #add_post(*args) ⇒ Object
-
#initialize(fixture_info) ⇒ Fixture
constructor
A new instance of Fixture.
- #list ⇒ Object
- #make_fixtures! ⇒ Object
Constructor Details
#initialize(fixture_info) ⇒ Fixture
7 8 9 10 11 12 13 14 15 |
# File 'lib/somefixtures/fixture.rb', line 7 def initialize fixture_info @format = fixture_info[:format] @base_uri = fixture_info[:base_uri] @save_to = fixture_info[:save_to] @login = fixture_info[:login] @token = fixture_info[:token] @fixtures = {} end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
5 6 7 |
# File 'lib/somefixtures/fixture.rb', line 5 def base_uri @base_uri end |
#fixtures ⇒ Object
Returns the value of attribute fixtures.
5 6 7 |
# File 'lib/somefixtures/fixture.rb', line 5 def fixtures @fixtures end |
#format ⇒ Object
Returns the value of attribute format.
5 6 7 |
# File 'lib/somefixtures/fixture.rb', line 5 def format @format end |
#login ⇒ Object
Returns the value of attribute login.
5 6 7 |
# File 'lib/somefixtures/fixture.rb', line 5 def login @login end |
#save_to ⇒ Object
Returns the value of attribute save_to.
5 6 7 |
# File 'lib/somefixtures/fixture.rb', line 5 def save_to @save_to end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/somefixtures/fixture.rb', line 5 def token @token end |
Instance Method Details
#add_get(*args) ⇒ Object
18 |
# File 'lib/somefixtures/fixture.rb', line 18 def add_get(*args); add_fixture(:get, *args) end |
#add_post(*args) ⇒ Object
17 |
# File 'lib/somefixtures/fixture.rb', line 17 def add_post(*args); add_fixture(:post, *args) end |
#list ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/somefixtures/fixture.rb', line 24 def list if @fixtures != {} @fixtures.each{|f| puts f } else print "Empty\n" end end |
#make_fixtures! ⇒ Object
20 21 22 |
# File 'lib/somefixtures/fixture.rb', line 20 def make_fixtures! save query_fixtures end |