Class: Ondotori::WebAPI::Api::Param
- Inherits:
-
Object
- Object
- Ondotori::WebAPI::Api::Param
- Defined in:
- lib/ondotori/webapi/api/param.rb
Constant Summary collapse
- API_KEY =
"api-key"
- LOGIN_ID =
"login-id"
- LOGIN_PASS =
"login-pass"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#login_id ⇒ Object
readonly
Returns the value of attribute login_id.
-
#login_pass ⇒ Object
readonly
Returns the value of attribute login_pass.
Instance Method Summary collapse
-
#initialize(params) ⇒ Param
constructor
A new instance of Param.
- #validate(params) ⇒ Object
Constructor Details
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/ondotori/webapi/api/param.rb', line 11 def api_key @api_key end |
#login_id ⇒ Object (readonly)
Returns the value of attribute login_id.
11 12 13 |
# File 'lib/ondotori/webapi/api/param.rb', line 11 def login_id @login_id end |
#login_pass ⇒ Object (readonly)
Returns the value of attribute login_pass.
11 12 13 |
# File 'lib/ondotori/webapi/api/param.rb', line 11 def login_pass @login_pass end |
Instance Method Details
#validate(params) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ondotori/webapi/api/param.rb', line 21 def validate(params) unless params.key?(Param::API_KEY) raise Ondotori::WebAPI::Api::Errors::InitializeParameterNotFound.new(Param::API_KEY, 9999) end unless params.key?(Param::LOGIN_ID) raise Ondotori::WebAPI::Api::Errors::InitializeParameterNotFound.new(Param::LOGIN_ID, 9998) end unless params.key?(Param::LOGIN_PASS) raise Ondotori::WebAPI::Api::Errors::InitializeParameterNotFound.new(Param::LOGIN_PASS, 9997) end end |