Class: BotMob::Install

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/bot_mob/install.rb

Class Method Summary collapse

Class Method Details

.create_with_auth(auth) ⇒ Object



9
10
11
12
13
14
# File 'lib/bot_mob/install.rb', line 9

def self.create_with_auth(auth)
  registered_bot(auth).first_or_initialize.tap do |i|
    i.data = auth['data']
    i.save!
  end
end

.registered_bot(auth) ⇒ Object



5
6
7
# File 'lib/bot_mob/install.rb', line 5

def self.registered_bot(auth)
  where(bot_class: auth['bot_class'], external_id: auth['external_id'])
end