Class: Postal::Base
- Inherits:
-
Object
- Object
- Postal::Base
- Defined in:
- lib/postal/base.rb
Class Method Summary collapse
-
.all ⇒ Object
Alias for find(:all).
-
.create(*args) ⇒ Object
Make a new user and immediately save to Lyris.
-
.create!(*args) ⇒ Object
Make a new user and immediately save to Lyris, but throw an error if the save fails.
-
.find(*args) ⇒ Object
Find objects based on some options.
Class Method Details
.all ⇒ Object
Alias for find(:all)
17 18 19 |
# File 'lib/postal/base.rb', line 17 def all find(:all) end |
.create(*args) ⇒ Object
Make a new user and immediately save to Lyris
23 24 25 26 27 |
# File 'lib/postal/base.rb', line 23 def create(*args) instance = self.new(*args) instance.save return instance end |
.create!(*args) ⇒ Object
Make a new user and immediately save to Lyris, but throw an error if the save fails.
31 32 33 34 35 |
# File 'lib/postal/base.rb', line 31 def create!(*args) instance = self.new(*args) instance.save! return instance end |
.find(*args) ⇒ Object
Find objects based on some options
7 8 9 10 11 12 13 |
# File 'lib/postal/base.rb', line 7 def find(*args) = (args) case args.first when :all then find_all() else find_some(args,) end end |