Class: Endymion::Query
- Inherits:
-
Object
- Object
- Endymion::Query
- Defined in:
- lib/endymion/query.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#sorts ⇒ Object
readonly
Returns the value of attribute sorts.
Instance Method Summary collapse
-
#initialize(kind, filters, sorts, limit, offset) ⇒ Query
constructor
A new instance of Query.
- #to_h ⇒ Object
Constructor Details
#initialize(kind, filters, sorts, limit, offset) ⇒ Query
Returns a new instance of Query.
5 6 7 8 9 10 11 |
# File 'lib/endymion/query.rb', line 5 def initialize(kind, filters, sorts, limit, offset) @kind = kind @filters = filters || [] @sorts = sorts || [] @limit = limit @offset = offset end |
Instance Attribute Details
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
3 4 5 |
# File 'lib/endymion/query.rb', line 3 def filters @filters end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
3 4 5 |
# File 'lib/endymion/query.rb', line 3 def kind @kind end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
3 4 5 |
# File 'lib/endymion/query.rb', line 3 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
3 4 5 |
# File 'lib/endymion/query.rb', line 3 def offset @offset end |
#sorts ⇒ Object (readonly)
Returns the value of attribute sorts.
3 4 5 |
# File 'lib/endymion/query.rb', line 3 def sorts @sorts end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/endymion/query.rb', line 13 def to_h { :kind => kind, :filters => filters.map(&:to_h), :sorts => sorts.map(&:to_h), :limit => limit, :offset => offset } end |