Class: ArelExtensions::Nodes::Format
- Defined in:
- lib/arel_extensions/nodes/format.rb
Constant Summary collapse
- RETURN_TYPE =
:string
Constants inherited from Function
ArelExtensions::Nodes::Function::MBSTRING
Instance Attribute Summary collapse
-
#col_type ⇒ Object
Returns the value of attribute col_type.
-
#iso_format ⇒ Object
Returns the value of attribute iso_format.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
Instance Method Summary collapse
-
#initialize(expr) ⇒ Format
constructor
A new instance of Format.
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(expr) ⇒ Format
Returns a new instance of Format.
10 11 12 13 14 15 16 |
# File 'lib/arel_extensions/nodes/format.rb', line 10 def initialize expr col = expr[0] @iso_format = convert_format(expr[1]) @time_zone = expr[2] @col_type = type_of_attribute(col) super [col, convert_to_string_node(@iso_format)] end |
Instance Attribute Details
#col_type ⇒ Object
Returns the value of attribute col_type.
8 9 10 |
# File 'lib/arel_extensions/nodes/format.rb', line 8 def col_type @col_type end |
#iso_format ⇒ Object
Returns the value of attribute iso_format.
8 9 10 |
# File 'lib/arel_extensions/nodes/format.rb', line 8 def iso_format @iso_format end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
8 9 10 |
# File 'lib/arel_extensions/nodes/format.rb', line 8 def time_zone @time_zone end |