Sha256: 068578108c8beb84024a70daef3400c4c48c3825e93d3c08d90fc04647da857d

Contents?: true

Size: 452 Bytes

Versions: 7

Compression:

Stored size: 452 Bytes

Contents

module Rasti
  module DB
    module NQL
      module Nodes
        class Field < Treetop::Runtime::SyntaxNode

          def identifier
            tables.empty? ? Sequel[column.to_sym] : Sequel[tables.join('__').to_sym][column.to_sym]
          end

          def tables
            _tables.elements.map{ |e| e.table.text_value }
          end

          def column
            _column.text_value
          end

        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rasti-db-2.0.1 lib/rasti/db/nql/nodes/field.rb
rasti-db-2.0.0 lib/rasti/db/nql/nodes/field.rb
rasti-db-1.5.0 lib/rasti/db/nql/nodes/field.rb
rasti-db-1.4.0 lib/rasti/db/nql/nodes/field.rb
rasti-db-1.3.1 lib/rasti/db/nql/nodes/field.rb
rasti-db-1.3.0 lib/rasti/db/nql/nodes/field.rb
rasti-db-1.2.0 lib/rasti/db/nql/nodes/field.rb