Class: MotoRecall::RecallSet
- Inherits:
-
Object
- Object
- MotoRecall::RecallSet
- Defined in:
- lib/moto_recall/recall_set.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#original_response ⇒ Object
readonly
Returns the value of attribute original_response.
Instance Method Summary collapse
-
#initialize(recalls, opts = {}) ⇒ RecallSet
constructor
A new instance of RecallSet.
- #method_missing(sym, *args, &block) ⇒ Object
- #respond_to?(sym, include_all = false) ⇒ Boolean
- #to_json ⇒ Object
Constructor Details
#initialize(recalls, opts = {}) ⇒ RecallSet
5 6 7 8 |
# File 'lib/moto_recall/recall_set.rb', line 5 def initialize(recalls, opts = {}) @items = recalls @original_response = opts[:original_response] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
18 19 20 |
# File 'lib/moto_recall/recall_set.rb', line 18 def method_missing(sym, *args, &block) @items.respond_to?(sym) ? @items.send(sym, *args, &block) : super end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
3 4 5 |
# File 'lib/moto_recall/recall_set.rb', line 3 def items @items end |
#original_response ⇒ Object (readonly)
Returns the value of attribute original_response.
3 4 5 |
# File 'lib/moto_recall/recall_set.rb', line 3 def original_response @original_response end |
Instance Method Details
#respond_to?(sym, include_all = false) ⇒ Boolean
14 15 16 |
# File 'lib/moto_recall/recall_set.rb', line 14 def respond_to?(sym, include_all = false) @items.respond_to?(sym) || super end |
#to_json ⇒ Object
10 11 12 |
# File 'lib/moto_recall/recall_set.rb', line 10 def to_json @items.map(&:to_h).to_json end |