Class: ApiQueryLanguage::Sorting::SortExpression
- Inherits:
-
Object
- Object
- ApiQueryLanguage::Sorting::SortExpression
- Defined in:
- lib/api_query_language/sorting/sort_expression.rb
Instance Attribute Summary collapse
-
#field_to_attribute_mappings ⇒ Object
readonly
Returns the value of attribute field_to_attribute_mappings.
-
#parsed ⇒ Object
readonly
Returns the value of attribute parsed.
-
#sort_expression ⇒ Object
readonly
Returns the value of attribute sort_expression.
Instance Method Summary collapse
-
#initialize(sort_expression, field_to_attribute_mappings = {}) ⇒ SortExpression
constructor
A new instance of SortExpression.
- #to_s ⇒ Object
Constructor Details
#initialize(sort_expression, field_to_attribute_mappings = {}) ⇒ SortExpression
Returns a new instance of SortExpression.
4 5 6 7 8 |
# File 'lib/api_query_language/sorting/sort_expression.rb', line 4 def initialize(sort_expression, field_to_attribute_mappings = {}) @sort_expression = sort_expression @field_to_attribute_mappings = field_to_attribute_mappings parse_expression! end |
Instance Attribute Details
#field_to_attribute_mappings ⇒ Object (readonly)
Returns the value of attribute field_to_attribute_mappings.
10 11 12 |
# File 'lib/api_query_language/sorting/sort_expression.rb', line 10 def field_to_attribute_mappings @field_to_attribute_mappings end |
#parsed ⇒ Object (readonly)
Returns the value of attribute parsed.
10 11 12 |
# File 'lib/api_query_language/sorting/sort_expression.rb', line 10 def parsed @parsed end |
#sort_expression ⇒ Object (readonly)
Returns the value of attribute sort_expression.
10 11 12 |
# File 'lib/api_query_language/sorting/sort_expression.rb', line 10 def sort_expression @sort_expression end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/api_query_language/sorting/sort_expression.rb', line 12 def to_s "#{self.class.name}(sort_expression: '#{sort_expression}')" end |