Class: OrcaApi::MedicalPracticeService::ResponseResult

Inherits:
Result
  • Object
show all
Defined in:
lib/orca_api/medical_practice_service.rb

Overview

診療行為APIのレスポンスクラスの基底クラス

Direct Known Subclasses

Response1Result, Response2Result, Response3Result

Direct Known Subclasses

Response1Result, Response2Result, Response3Result

Constant Summary

Constants inherited from Result

Result::LOCKED_API_RESULT

Instance Attribute Summary

Attributes inherited from Result

#raw

Instance Method Summary collapse

Methods inherited from Result

#[], #body, def_info, #locked?, #message, #method_missing, parse, #respond_to_missing?, trim_response, #warning?

Constructor Details

#initialize(raw, ignore_medical_warnings = nil) ⇒ ResponseResult

Returns a new instance of ResponseResult

Parameters:

  • raw (String)

    JSON文字列

  • ignore_medical_warnings (Array<String>, nil) (defaults to: nil)

    無視する警告コード



84
85
86
87
# File 'lib/orca_api/medical_practice_service.rb', line 84

def initialize(raw, ignore_medical_warnings = nil)
  super(raw)
  @ignore_medical_warnings = Array[ignore_medical_warnings].flatten.compact
end

Constructor Details

#initialize(raw, ignore_medical_warnings = nil) ⇒ ResponseResult

Returns a new instance of ResponseResult

Parameters:

  • raw (String)

    JSON文字列

  • ignore_medical_warnings (Array<String>, nil) (defaults to: nil)

    無視する警告コード



84
85
86
87
# File 'lib/orca_api/medical_practice_service.rb', line 84

def initialize(raw, ignore_medical_warnings = nil)
  super(raw)
  @ignore_medical_warnings = Array[ignore_medical_warnings].flatten.compact
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OrcaApi::Result

Instance Method Details

#ok?Boolean

APIレスポンスに警告コードが含まれていればfalseを返す。それ以外の場合は、 OrcaApi::Result#ok? を呼び出す

Returns:

  • (Boolean)

See Also:



91
92
93
# File 'lib/orca_api/medical_practice_service.rb', line 91

def ok?
  warning_codes.empty? ? super : false
end