Class: Sequel::Fixture::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/sequel-fixture/table.rb

Overview

Description

Class which represents a single row in a fixture table.

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ Row

Returns a new instance of Row.



27
28
29
# File 'lib/sequel-fixture/table.rb', line 27

def initialize(row)
  @data = row
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(s, *args) ⇒ Object

Description

Method missing, for enabling discovery of columns within a row



34
35
36
37
38
# File 'lib/sequel-fixture/table.rb', line 34

def method_missing(s, *args)
  key = s.to_s
  return @data[key] if @data && @data.has_key?(key)
  return super
end