Class: CPApiReturn

Inherits:
Object
  • Object
show all
Defined in:
lib/crowi/client/apireq/api_request_base.rb

Overview

APIリクエストの応答基本クラス

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CPApiReturn

Constractor

Parameters:

  • ok (String)

    Result of API



25
26
27
28
29
30
31
# File 'lib/crowi/client/apireq/api_request_base.rb', line 25

def initialize(params = {})
  if (! params[:ok].is_a?(TrueClass) && ! params[:ok].is_a?(FalseClass))
    raise ArgumentError.new('Parameter ok is needed true or false.')
  end
  @ok = params[:ok]
  @data = params[:data]
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



21
22
23
# File 'lib/crowi/client/apireq/api_request_base.rb', line 21

def data
  @data
end

#okObject

Returns the value of attribute ok.



21
22
23
# File 'lib/crowi/client/apireq/api_request_base.rb', line 21

def ok
  @ok
end