Class: KintoneNotifier::Bot
- Inherits:
-
Object
- Object
- KintoneNotifier::Bot
- Defined in:
- lib/kintone_notifier.rb
Overview
configuration (required)
url : includes ".cybozu.com"
user : kintone user name
password : kintone user password
app_id : kintone application id
examples #in your config/initializers/
KintoneNotifier::Bot.config = {
:url => "xxxxx.cybozu.com",
:user => "your-user-name",
:password => "your-password",
:app_id => 1
}
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Bot
constructor
A new instance of Bot.
- #tweet(values = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Bot
Returns a new instance of Bot.
35 36 37 38 39 |
# File 'lib/kintone_notifier.rb', line 35 def initialize(={}) raise ArgumentError, "invalid argument. class configuration haven't been given." if @@config.blank? = .reverse_merge() @api = Kintone::Api.new(["url"],["user"],["password"]) end |
Class Method Details
.config=(h) ⇒ Object
44 45 46 |
# File 'lib/kintone_notifier.rb', line 44 def self.config=(h) @@config = h end |
Instance Method Details
#tweet(values = {}) ⇒ Object
40 41 42 |
# File 'lib/kintone_notifier.rb', line 40 def tweet(values={}) @api.record.create(["app_id"],convert_hash(values.reverse_merge(default_values))) end |