Class: Troo::CardRetrieval
- Inherits:
-
Object
- Object
- Troo::CardRetrieval
- Defined in:
- lib/troo/models/card_retrieval.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id = nil) ⇒ CardRetrieval
constructor
A new instance of CardRetrieval.
- #retrieve ⇒ Object
Constructor Details
#initialize(id = nil) ⇒ CardRetrieval
Returns a new instance of CardRetrieval.
17 18 19 |
# File 'lib/troo/models/card_retrieval.rb', line 17 def initialize(id = nil) @id = id end |
Class Method Details
.all ⇒ Object
4 5 6 |
# File 'lib/troo/models/card_retrieval.rb', line 4 def all Troo::Card.all end |
.default ⇒ Object
8 9 10 |
# File 'lib/troo/models/card_retrieval.rb', line 8 def default new.retrieve end |
.retrieve(id = nil) ⇒ Object
12 13 14 |
# File 'lib/troo/models/card_retrieval.rb', line 12 def retrieve(id = nil) new(id).retrieve end |
Instance Method Details
#retrieve ⇒ Object
21 22 23 24 |
# File 'lib/troo/models/card_retrieval.rb', line 21 def retrieve return default unless id by_short_id || by_id || by_external_id || remote end |