Class: Prof::PushedTestApp

Inherits:
Object
  • Object
show all
Defined in:
lib/prof/pushed_test_app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ PushedTestApp

Returns a new instance of PushedTestApp.



16
17
18
19
# File 'lib/prof/pushed_test_app.rb', line 16

def initialize(opts = {})
  @name = opts.fetch(:name)
  @url  = opts.fetch(:url)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'lib/prof/pushed_test_app.rb', line 21

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



21
22
23
# File 'lib/prof/pushed_test_app.rb', line 21

def url
  @url
end

Instance Method Details

#read(key) ⇒ Object



27
28
29
# File 'lib/prof/pushed_test_app.rb', line 27

def read(key)
  app_connection.get("/testdata/key/#{key}").body
end

#write(key, value) ⇒ Object



23
24
25
# File 'lib/prof/pushed_test_app.rb', line 23

def write(key, value)
  app_connection.put("/testdata/key/#{key}/value/#{value}")
end