Class: DocomoNlu::Management::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/docomo_nlu/management/account.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

check_response, headers, #id_from_response, instantiate_collection, instantiate_record, #login, #logout, #static_headers

Class Method Details

.countObject

Parameter for create

"accountName": "your account name",
"password": "your account password",
"description": "account description",
"authorization": 2,
"enable": true
"eternity": true



19
20
21
22
# File 'lib/docomo_nlu/management/account.rb', line 19

def self.count
  response_body = JSON.parse(connection.get("#{prefix}#{element_name}/count", headers).body)
  response_body["count"]
end

Instance Method Details

#to_json(options = {}) ⇒ Object



24
25
26
27
28
# File 'lib/docomo_nlu/management/account.rb', line 24

def to_json(options = {})
  enable_params = ["accountName", "password", "description", "authorization", "enable", "eternity"]
  attributes.select! {|a| enable_params.include?(a) }
  super
end