Class: Testrail::APIClient

Inherits:
Object
  • Object
show all
Defined in:
lib/tagrail/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url) ⇒ APIClient

Returns a new instance of APIClient.



60
61
62
63
64
65
# File 'lib/tagrail/client.rb', line 60

def initialize(base_url)
  if !base_url.match(/\/$/)
    base_url += '/'
  end
  @url = base_url + 'index.php?/api/v2/'
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



58
59
60
# File 'lib/tagrail/client.rb', line 58

def password
  @password
end

#userObject

Returns the value of attribute user.



57
58
59
# File 'lib/tagrail/client.rb', line 57

def user
  @user
end

Instance Method Details

#send_get(uri) ⇒ Object



67
68
69
# File 'lib/tagrail/client.rb', line 67

def send_get(uri)
  _send_request('GET', uri, nil)
end

#send_post(uri, data) ⇒ Object



71
72
73
# File 'lib/tagrail/client.rb', line 71

def send_post(uri, data)
  _send_request('POST', uri, data)
end