Class: Transport::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/transport/json.rb

Overview

Extended transport layer for http transfers. Basic authorization and JSON transfers are supported.

Instance Attribute Summary collapse

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

request

Constructor Details

#initialize(http_method, url, options = { }) ⇒ JSON



14
15
16
17
18
19
20
21
# File 'lib/transport/json.rb', line 14

def initialize(http_method, url, options = { })
  @options = options
  modify_headers
  modify_parameters
  modify_body
  super http_method, url, @options
  initialize_authentication
end

Instance Attribute Details

#auth_typeObject (readonly)

Returns the value of attribute auth_type.



10
11
12
# File 'lib/transport/json.rb', line 10

def auth_type
  @auth_type
end

#expected_status_codeObject (readonly)

Returns the value of attribute expected_status_code.



9
10
11
# File 'lib/transport/json.rb', line 9

def expected_status_code
  @expected_status_code
end

#passwordObject (readonly)

Returns the value of attribute password.



12
13
14
# File 'lib/transport/json.rb', line 12

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



11
12
13
# File 'lib/transport/json.rb', line 11

def username
  @username
end

Instance Method Details

#performObject



23
24
25
26
# File 'lib/transport/json.rb', line 23

def perform
  super
  parse_response
end