Class: KintoneNotifier::Bot

Inherits:
Object
  • Object
show all
Defined in:
lib/kintone_notifier/bot.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Bot

Returns a new instance of Bot.

Raises:

  • (ArgumentError)


4
5
6
7
8
# File 'lib/kintone_notifier/bot.rb', line 4

def initialize(options={})
  raise ArgumentError, "invalid argument. class configuration haven't been given." if @@config.blank?
  @options = default_options.reverse_merge(default_options)
  @api =  Kintone::Api.new(@options["url"],@options["user"],@options["password"])
end

Class Method Details

.config=(h) ⇒ Object



13
14
15
# File 'lib/kintone_notifier/bot.rb', line 13

def self.config=(h)
  @@config = h
end

Instance Method Details

#tweet(values = {}) ⇒ Object



9
10
11
# File 'lib/kintone_notifier/bot.rb', line 9

def tweet(values={})
  @api.record.create(@options["app_id"],convert_hash(values.reverse_merge(default_values)))
end