Class: BotMob::Install

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_with_auth(auth) ⇒ Object



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

def self.create_with_auth(auth)
  where(external_id: auth[:external_id]).first_or_initialize.tap do |i|
    i.token = auth[:token]
    i.save!
  end
end

Instance Method Details

#authObject



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

def auth
  { external_id: external_id, token: token }
end