Class: SomeFixtures::Fixture

Inherits:
Object
  • Object
show all
Defined in:
lib/somefixtures/fixture.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_uriObject

Returns the value of attribute base_uri.



5
6
7
# File 'lib/somefixtures/fixture.rb', line 5

def base_uri
  @base_uri
end

#fixturesObject

Returns the value of attribute fixtures.



5
6
7
# File 'lib/somefixtures/fixture.rb', line 5

def fixtures
  @fixtures
end

#formatObject

Returns the value of attribute format.



5
6
7
# File 'lib/somefixtures/fixture.rb', line 5

def format
  @format
end

#loginObject

Returns the value of attribute login.



5
6
7
# File 'lib/somefixtures/fixture.rb', line 5

def 
  @login
end

#save_toObject

Returns the value of attribute save_to.



5
6
7
# File 'lib/somefixtures/fixture.rb', line 5

def save_to
  @save_to
end

#tokenObject

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

#listObject



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