Class: Graffiti::SqlNodeBinding
- Inherits:
-
Object
- Object
- Graffiti::SqlNodeBinding
- Defined in:
- lib/graffiti/sql_mapper.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
readonly
Returns the value of attribute alias.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
- #eql?(binding) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(table_alias, field) ⇒ SqlNodeBinding
constructor
A new instance of SqlNodeBinding.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(table_alias, field) ⇒ SqlNodeBinding
Returns a new instance of SqlNodeBinding.
23 24 25 26 |
# File 'lib/graffiti/sql_mapper.rb', line 23 def initialize(table_alias, field) @alias = table_alias @field = field end |
Instance Attribute Details
#alias ⇒ Object (readonly)
Returns the value of attribute alias.
28 29 30 |
# File 'lib/graffiti/sql_mapper.rb', line 28 def alias @alias end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
28 29 30 |
# File 'lib/graffiti/sql_mapper.rb', line 28 def field @field end |
Instance Method Details
#eql?(binding) ⇒ Boolean Also known as: ==
36 37 38 |
# File 'lib/graffiti/sql_mapper.rb', line 36 def eql?(binding) @alias == binding.alias and @field == binding.field end |
#hash ⇒ Object
42 43 44 |
# File 'lib/graffiti/sql_mapper.rb', line 42 def hash self.to_s.hash end |
#to_s ⇒ Object Also known as: inspect
30 31 32 |
# File 'lib/graffiti/sql_mapper.rb', line 30 def to_s @alias + '.' + @field end |