Class: Etapper::Gift

Inherits:
JournalEntry show all
Defined in:
lib/etapper/classes/gift.rb

Constant Summary

Constants inherited from JournalEntry

JournalEntry::TYPES

Instance Attribute Summary

Attributes inherited from JournalEntry

#type

Class Method Summary collapse

Methods inherited from JournalEntry

#account, #account=, #definedValues, findByAccount, getter, #initialize, symbolize, type

Methods inherited from EtapAbstract

#==, #base, cname, etap_read_only, #initialize, #method_missing, #new?, #save

Constructor Details

This class inherits a constructor from Etapper::JournalEntry

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Etapper::EtapAbstract

Class Method Details

.find(query) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/etapper/classes/gift.rb', line 9

def self.find(query)
  case query
  when /\d+\.\d+\.\d+/  # "4310.0.2276679"
    g = client.getGift(query)
    Gift.new(g) if g
  when Hash
    a = Account.find(query[:account])
    findByAccount(a)
  end
end