Class: OrderBy
Instance Method Summary collapse
- #descending? ⇒ Boolean
- #expressions ⇒ Object
-
#initialize(node) ⇒ OrderBy
constructor
A new instance of OrderBy.
- #last_arg ⇒ Object
Constructor Details
#initialize(node) ⇒ OrderBy
Returns a new instance of OrderBy.
21 22 23 |
# File 'lib/linqr.rb', line 21 def initialize(node) @node = node end |
Instance Method Details
#descending? ⇒ Boolean
29 30 31 |
# File 'lib/linqr.rb', line 29 def descending? last_arg.is_a? Ruby::Hash end |
#expressions ⇒ Object
25 26 27 |
# File 'lib/linqr.rb', line 25 def expressions descending?? (@node.arguments[0...-1] << last_arg.first.key): @node.arguments end |
#last_arg ⇒ Object
33 34 35 |
# File 'lib/linqr.rb', line 33 def last_arg @node.arguments.last.arg end |