Module: WiseGopher::Row::ClassMethods

Defined in:
lib/wise_gopher/row.rb

Overview

Row class methods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



18
19
20
# File 'lib/wise_gopher/row.rb', line 18

def columns
  @columns
end

#ignored_columnsObject (readonly)

Returns the value of attribute ignored_columns.



18
19
20
# File 'lib/wise_gopher/row.rb', line 18

def ignored_columns
  @ignored_columns
end

Instance Method Details

#column(name, type, **kwargs) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/wise_gopher/row.rb', line 20

def column(name, type, **kwargs)
  column = WiseGopher::Column.new(name, type, **kwargs)

  column.define_getter(self)

  columns[column.name] = column
end

#ignore(column_name) ⇒ Object



28
29
30
# File 'lib/wise_gopher/row.rb', line 28

def ignore(column_name)
  @ignored_columns << column_name.to_s.freeze
end