Sha256: 1fef134b31a4bd4ee6ed56088bfea77858f97f59c287281b43afe3e96ce6abb8

Contents?: true

Size: 710 Bytes

Versions: 4

Compression:

Stored size: 710 Bytes

Contents

module Sequel; end

class Sequel::Fixture
  
  # === Description
  # Class which represents the actual fixture data in a table
  #
  class Table
    def initialize(data)
      @data = data
    end

    def [](row)
      Sequel::Fixture::Row.new(@data[row])
    end
    
    def rows
      @data
    end
  end

  
  # === Description
  # Class which represents a single row in a fixture table.
  #
  class Row
    def initialize(row)
      @data = row
    end
    
    # === Description
    # Method missing, for enabling discovery of columns within a row
    #
    def method_missing(s, *args)
      key = s.to_s
      return @data[key] if @data && @data.has_key?(key)
      return super
    end    
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
gamera-sequel-fixture-2.0.4 lib/sequel-fixture/table.rb
gamera-sequel-fixture-2.0.3 lib/sequel-fixture/table.rb
sequel-fixture-2.0.1 lib/sequel-fixture/table.rb
sequel-fixture-2.0.0 lib/sequel-fixture/table.rb