Class: Piglet::Field::Rename
- Inherits:
-
Object
- Object
- Piglet::Field::Rename
- Defined in:
- lib/piglet/field/rename.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(new_name, field_expression) ⇒ Rename
constructor
A new instance of Rename.
- #to_s ⇒ Object
Constructor Details
#initialize(new_name, field_expression) ⇒ Rename
Returns a new instance of Rename.
8 9 10 |
# File 'lib/piglet/field/rename.rb', line 8 def initialize(new_name, field_expression) @name, @field_expression, @type = new_name, field_expression, field_expression.type end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/piglet/field/rename.rb', line 6 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/piglet/field/rename.rb', line 6 def type @type end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/piglet/field/rename.rb', line 12 def to_s "#{@field_expression} AS #{@name}" end |