Exception: Wordpress::ResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/wordpress/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json = {}) ⇒ ResponseError

Returns a new instance of ResponseError.



5
6
7
8
# File 'lib/wordpress/errors.rb', line 5

def initialize(json = {})
  @error = json['error'] || 'unknown'
  @message = json['message']
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/wordpress/errors.rb', line 3

def error
  @error
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/wordpress/errors.rb', line 3

def message
  @message
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/wordpress/errors.rb', line 10

def to_s
  @message
end