Class: PixivApi::Response::Action

Inherits:
PixivApi::Response show all
Defined in:
lib/pixiv_api/response/action.rb

Instance Attribute Summary collapse

Attributes inherited from PixivApi::Response

#attributes, #response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PixivApi::Response

#[], attr_reader, define_attribute_method, define_attributes_method, define_blob_method, define_time_method, #initialize

Constructor Details

This class inherits a constructor from PixivApi::Response

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/pixiv_api/response/action.rb', line 4

def status
  @status
end

Class Method Details

.from_response(response) ⇒ Object



6
7
8
# File 'lib/pixiv_api/response/action.rb', line 6

def self.from_response(response)
  new(response, response.parsed)
end

Instance Method Details

#errorsObject



10
11
12
# File 'lib/pixiv_api/response/action.rb', line 10

def errors
  fetch('errors', {})
end

#failure?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/pixiv_api/response/action.rb', line 18

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/pixiv_api/response/action.rb', line 14

def success?
  status == 'success'
end