Class: Icalia::Artanis::AccessToken

Inherits:
Resource
  • Object
show all
Defined in:
lib/icalia/artanis/access_token.rb

Class Method Summary collapse

Class Method Details

.find(*args) ⇒ Object



4
5
6
7
# File 'lib/icalia/artanis/access_token.rb', line 4

def self.find(*args)
  a = super
  a.first if a.any?
end

.find_by(attributes = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/icalia/artanis/access_token.rb', line 9

def self.find_by(attributes = {})
  raise "No attributes" unless attributes.any?
  a = where(attributes).limit(1).to_a
  return nil unless a.any?
  a.first
end