Class: Tarpon::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tarpon/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, attributes) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
# File 'lib/tarpon/response.rb', line 7

def initialize(status, attributes)
  @status     = status
  @raw        = attributes
  @subscriber = @raw[:subscriber] && Entity::Subscriber.new(@raw[:subscriber])
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



5
6
7
# File 'lib/tarpon/response.rb', line 5

def raw
  @raw
end

#subscriberObject (readonly)

Returns the value of attribute subscriber.



5
6
7
# File 'lib/tarpon/response.rb', line 5

def subscriber
  @subscriber
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/tarpon/response.rb', line 13

def message
  @raw[:message]
end

#success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/tarpon/response.rb', line 17

def success?
  @status.success?
end