Class: ArelExtensions::Nodes::JsonGroup
Constant Summary
Constants inherited from JsonNode
ArelExtensions::Nodes::JsonNode::RETURN_TYPE
Constants inherited from Function
Instance Attribute Summary collapse
-
#as_array ⇒ Object
Returns the value of attribute as_array.
-
#orders ⇒ Object
Returns the value of attribute orders.
Attributes inherited from JsonNode
Instance Method Summary collapse
-
#initialize(json, as_array = true, orders = nil) ⇒ JsonGroup
constructor
A new instance of JsonGroup.
Methods inherited from JsonNode
Methods inherited from Function
#as, #convert_to_date_node, #convert_to_datetime_node, #convert_to_node, #convert_to_number, #convert_to_string_node, #expr, #left, #return_type, #right, #type_of_attribute
Methods included from Predications
#cast, #convert_to_node, #imatches, #in, #matches, #not_in, #when
Constructor Details
#initialize(json, as_array = true, orders = nil) ⇒ JsonGroup
Returns a new instance of JsonGroup.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/arel_extensions/nodes/json.rb', line 67 def initialize json, as_array = true, orders = nil @hash = as_array ? json : json.hash @as_array = as_array if orders if orders.is_a?(Array) @orders = orders else @orders = [orders] end end end |
Instance Attribute Details
#as_array ⇒ Object
Returns the value of attribute as_array.
65 66 67 |
# File 'lib/arel_extensions/nodes/json.rb', line 65 def as_array @as_array end |
#orders ⇒ Object
Returns the value of attribute orders.
65 66 67 |
# File 'lib/arel_extensions/nodes/json.rb', line 65 def orders @orders end |