Exception: Tweetwine::HttpError

Inherits:
Error
  • Object
show all
Defined in:
lib/tweetwine/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

status_code, #status_code

Constructor Details

#initialize(code, message) ⇒ HttpError

Returns a new instance of HttpError.



44
45
46
# File 'lib/tweetwine/exceptions.rb', line 44

def initialize(code, message)
  @http_code, @http_message = code.to_i, message
end

Instance Attribute Details

#http_codeObject (readonly)

Returns the value of attribute http_code.



42
43
44
# File 'lib/tweetwine/exceptions.rb', line 42

def http_code
  @http_code
end

#http_messageObject (readonly)

Returns the value of attribute http_message.



42
43
44
# File 'lib/tweetwine/exceptions.rb', line 42

def http_message
  @http_message
end

Instance Method Details

#to_sObject



48
49
50
# File 'lib/tweetwine/exceptions.rb', line 48

def to_s
  "#{http_code} #{http_message}"
end