Module: DeclarativeGrid::Model

Included in:
Base
Defined in:
lib/declarative_grid/model.rb,
lib/declarative_grid/model/row.rb,
lib/declarative_grid/model/column.rb

Defined Under Namespace

Classes: Column, Row

Instance Method Summary collapse

Instance Method Details

#column(name, options = {}, &block) ⇒ Object

Define a column REFERENCE: Model::Row#define_column



12
13
14
# File 'lib/declarative_grid/model.rb', line 12

def column(name, options = {}, &block)
  self.row.define_column(name, options, &block)
end

#columns(*args) ⇒ Object

Return the columns REFERENCE: Model::Row#columns



18
19
20
# File 'lib/declarative_grid/model.rb', line 18

def columns(*args)
  self.row.columns(*args)
end

#inherited(subclass) ⇒ Object

override Class.inherited



23
24
25
26
# File 'lib/declarative_grid/model.rb', line 23

def inherited(subclass)
  super(subclass)
  subclass.instance_variable_set :@row, self.row.dup
end

#rowObject



6
7
8
# File 'lib/declarative_grid/model.rb', line 6

def row
  @row ||= Row.new
end