Class: CardsManager
- Inherits:
-
Object
- Object
- CardsManager
- Defined in:
- lib/cards_manager.rb
Constant Summary collapse
- InvalidValue =
Class.new(StandardError)
- UnknownAttribute =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#cards_source ⇒ Object
readonly
Returns the value of attribute cards_source.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query, cards_source) ⇒ CardsManager
constructor
A new instance of CardsManager.
- #requested_cards ⇒ Object
Constructor Details
#initialize(query, cards_source) ⇒ CardsManager
Returns a new instance of CardsManager.
11 12 13 14 |
# File 'lib/cards_manager.rb', line 11 def initialize(query, cards_source) @query = query @cards_source = cards_source end |
Instance Attribute Details
#cards_source ⇒ Object (readonly)
Returns the value of attribute cards_source.
9 10 11 |
# File 'lib/cards_manager.rb', line 9 def cards_source @cards_source end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
9 10 11 |
# File 'lib/cards_manager.rb', line 9 def query @query end |
Instance Method Details
#requested_cards ⇒ Object
16 17 18 19 20 |
# File 'lib/cards_manager.rb', line 16 def requested_cards return cards_source if query.empty? group_and_select(query, cards_source) end |