Sha256: 2a9f6524a929d120e372711eccc51ef7d901ab92f9b88493f86509b6541cad0c

Contents?: true

Size: 291 Bytes

Versions: 16

Compression:

Stored size: 291 Bytes

Contents

module ActiveMocker

  class Table

    attr_reader :name, :fields

    def initialize(name, fields=[])
      @name   = name
      @fields = fields
    end

    def to_h
      {name: name, fields: fields.to_h}
    end

    def column_names
      fields.map { |f| f.name }
    end

  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
active_mocker-1.1.10 lib/active_mocker/table.rb
active_mocker-1.1.9 lib/active_mocker/table.rb
active_mocker-1.1.8 lib/active_mocker/table.rb
active_mocker-1.1.7 lib/active_mocker/table.rb
active_mocker-1.1.6 lib/active_mocker/table.rb
active_mocker-1.1.5 lib/active_mocker/table.rb
active_mocker-1.1.4 lib/active_mocker/table.rb
active_mocker-1.1.3 lib/active_mocker/table.rb
active_mocker-1.1.2 lib/active_mocker/table.rb
active_mocker-1.1.1 lib/active_mocker/table.rb
active_mocker-1.1.0 lib/active_mocker/table.rb
active_mocker-1.0.1 lib/active_mocker/table.rb
active_mocker-1.0.0 lib/active_mocker/table.rb
active_mocker-0.4.0 lib/active_mocker/table.rb
active_mocker-0.3.1 lib/active_mocker/table.rb
active_mocker-0.1.1 lib/active_mocker/table.rb