Class: BatchAny::Service
- Inherits:
-
Object
- Object
- BatchAny::Service
- Defined in:
- lib/batch_any/service.rb
Instance Attribute Summary collapse
-
#item_class ⇒ Object
readonly
Returns the value of attribute item_class.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
- #can_serve?(item) ⇒ Boolean
- #fetch ⇒ Object
-
#initialize(item) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(item) ⇒ Service
Returns a new instance of Service.
5 6 7 8 |
# File 'lib/batch_any/service.rb', line 5 def initialize(item) @item_class = item.class @items = [item] end |
Instance Attribute Details
#item_class ⇒ Object (readonly)
Returns the value of attribute item_class.
3 4 5 |
# File 'lib/batch_any/service.rb', line 3 def item_class @item_class end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
3 4 5 |
# File 'lib/batch_any/service.rb', line 3 def items @items end |
Instance Method Details
#can_serve?(item) ⇒ Boolean
10 11 12 |
# File 'lib/batch_any/service.rb', line 10 def can_serve?(item) raise "Not implemented: #{self.class}#can_serve?(item) -> truthy, required by BatchAny::Service" end |
#fetch ⇒ Object
14 15 16 |
# File 'lib/batch_any/service.rb', line 14 def fetch raise "Not implemented: #{self.class}#fetch, required by BatchAny::Service" end |