Class: ATM::Services::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
HTTParty
Defined in:
lib/atm_ruby/helpers/base_service.rb

Overview

ATM::Services::Base Base class for all of the services

Direct Known Subclasses

TestCase, TestPlan, TestRun

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Base

Returns a new instance of Base.



21
22
23
24
# File 'lib/atm_ruby/helpers/base_service.rb', line 21

def initialize(**options)
  self.class.base_uri options[:base_url]
  @auth_header = options[:auth_header]
end

Instance Attribute Details

#[]Object (readonly)

response - holds data after post/put/delete/get submited

Returns:

  • (Object)

    the current value of []



11
12
13
# File 'lib/atm_ruby/helpers/base_service.rb', line 11

def []
  @[]
end

#auth_headerObject (readonly)

Returns the value of attribute auth_header.



18
19
20
# File 'lib/atm_ruby/helpers/base_service.rb', line 18

def auth_header
  @auth_header
end

#headerHash (readonly)

  • access token for authentication

Returns:

  • (Hash)

    the current value of header



11
12
13
# File 'lib/atm_ruby/helpers/base_service.rb', line 11

def header
  @header
end

#project_idString (readonly)

  • user set project id

Returns:

  • (String)

    the current value of project_id



11
12
13
# File 'lib/atm_ruby/helpers/base_service.rb', line 11

def project_id
  @project_id
end

#responseObject (readonly)

Returns the value of attribute response.



18
19
20
# File 'lib/atm_ruby/helpers/base_service.rb', line 18

def response
  @response
end

Instance Method Details

#set_response(new_response) ⇒ Object



26
27
28
# File 'lib/atm_ruby/helpers/base_service.rb', line 26

def set_response(new_response)
  @response = new_response
end