Class: Torque::PostgreSQL::Arel::Nodes::Column
- Inherits:
-
Arel::Nodes::Binary
- Object
- Arel::Nodes::Binary
- Torque::PostgreSQL::Arel::Nodes::Column
- Includes:
- Arel::AliasPredication, Arel::Expressions, Arel::Math, Arel::OrderPredications, Arel::Predications
- Defined in:
- lib/torque/postgresql/arel/nodes.rb
Overview
Accessing a single column of a composite value, which behaves like an attribute of the composite type it belongs to
Instance Attribute Summary collapse
-
#type_caster ⇒ Object
readonly
Returns the value of attribute type_caster.
Instance Method Summary collapse
- #able_to_type_cast? ⇒ Boolean
-
#initialize(source, name, type_caster) ⇒ Column
constructor
A new instance of Column.
- #type_cast_for_database(value) ⇒ Object
Constructor Details
#initialize(source, name, type_caster) ⇒ Column
Returns a new instance of Column.
34 35 36 37 |
# File 'lib/torque/postgresql/arel/nodes.rb', line 34 def initialize(source, name, type_caster) @type_caster = type_caster super(source, name.to_s) end |
Instance Attribute Details
#type_caster ⇒ Object (readonly)
Returns the value of attribute type_caster.
31 32 33 |
# File 'lib/torque/postgresql/arel/nodes.rb', line 31 def type_caster @type_caster end |
Instance Method Details
#able_to_type_cast? ⇒ Boolean
39 40 41 |
# File 'lib/torque/postgresql/arel/nodes.rb', line 39 def able_to_type_cast? true end |
#type_cast_for_database(value) ⇒ Object
43 44 45 |
# File 'lib/torque/postgresql/arel/nodes.rb', line 43 def type_cast_for_database(value) type_caster.serialize(value) end |