Sha256: accc782389a5a358e77ea0a9c702f7beccf9b60bedfcf21448deb3756ad15428

Contents?: true

Size: 677 Bytes

Versions: 18

Compression:

Stored size: 677 Bytes

Contents

class Baza::Column
  include Baza::DatabaseModelFunctionality

  def to_s
    "#<#{self.class.name} name=\"#{name}\" type=\"#{type}\" maxlength=\"#{maxlength}\" autoincr=\"#{autoincr?}\" primarykey=\"#{primarykey?}\">"
  end

  def inspect
    to_s
  end

  def to_param
    name
  end

  def table
    @db.tables[table_name]
  end

  def after
    last = nil
    table.columns.each do |column|
      break if column.name == name
      last = column.name
    end

    last
  end

  def data
    {
      type: type,
      name: name,
      null: null?,
      maxlength: maxlength,
      default: default,
      primarykey: primarykey?,
      autoincr: autoincr?
    }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
baza-0.0.38 lib/baza/column.rb
baza-0.0.37 lib/baza/column.rb
baza-0.0.36 lib/baza/column.rb
baza-0.0.35 lib/baza/column.rb
baza-0.0.34 lib/baza/column.rb
baza-0.0.33 lib/baza/column.rb
baza-0.0.32 lib/baza/column.rb
baza-0.0.31 lib/baza/column.rb
baza-0.0.30 lib/baza/column.rb
baza-0.0.29 lib/baza/column.rb
baza-0.0.28 lib/baza/column.rb
baza-0.0.27 lib/baza/column.rb
baza-0.0.26 lib/baza/column.rb
baza-0.0.25 lib/baza/column.rb
baza-0.0.24 lib/baza/column.rb
baza-0.0.23 lib/baza/column.rb
baza-0.0.22 lib/baza/column.rb
baza-0.0.21 lib/baza/column.rb