Class: LetterMX::Subscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/letter_mx/subscriber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Subscriber

Returns a new instance of Subscriber.



10
11
12
13
14
15
16
17
18
# File 'lib/letter_mx/subscriber.rb', line 10

def initialize(response)
  @http_response = response

  if @http_response
    @http_status = @http_response.headers["status"] if @http_response.headers
    @http_body = @http_response.body
    @data = @http_response.parsed_response
  end
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/letter_mx/subscriber.rb', line 8

def data
  @data
end

#http_bodyObject (readonly)

Returns the value of attribute http_body.



7
8
9
# File 'lib/letter_mx/subscriber.rb', line 7

def http_body
  @http_body
end

#http_responseObject (readonly)

Returns the value of attribute http_response.



5
6
7
# File 'lib/letter_mx/subscriber.rb', line 5

def http_response
  @http_response
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



6
7
8
# File 'lib/letter_mx/subscriber.rb', line 6

def http_status
  @http_status
end