Class: WCC::Contentful::ModelSingletonMethods::ModelQuery
- Inherits:
-
Object
- Object
- WCC::Contentful::ModelSingletonMethods::ModelQuery
- Includes:
- Enumerable
- Defined in:
- lib/wcc/contentful/model_singleton_methods.rb
Instance Attribute Summary collapse
- #klass ⇒ Object readonly
- #options ⇒ Object readonly
- #wrapped_query ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(wrapped_query, options, klass) ⇒ ModelQuery
constructor
A new instance of ModelQuery.
- #to_enum ⇒ Object
Constructor Details
#initialize(wrapped_query, options, klass) ⇒ ModelQuery
Returns a new instance of ModelQuery.
89 90 91 92 93 |
# File 'lib/wcc/contentful/model_singleton_methods.rb', line 89 def initialize(wrapped_query, , klass) @wrapped_query = wrapped_query @options = @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
87 88 89 |
# File 'lib/wcc/contentful/model_singleton_methods.rb', line 87 def klass @klass end |
#options ⇒ Object (readonly)
87 88 89 |
# File 'lib/wcc/contentful/model_singleton_methods.rb', line 87 def @options end |
#wrapped_query ⇒ Object (readonly)
87 88 89 |
# File 'lib/wcc/contentful/model_singleton_methods.rb', line 87 def wrapped_query @wrapped_query end |
Instance Method Details
#to_enum ⇒ Object
95 96 97 98 |
# File 'lib/wcc/contentful/model_singleton_methods.rb', line 95 def to_enum wrapped_query.to_enum .map { |r| klass.new(r, ) } end |