Class: Views::Resources::ShowHasMany

Inherits:
Object
  • Object
show all
Defined in:
app/views/resources/show_has_many.rb

Defined Under Namespace

Classes: Column

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&config) ⇒ ShowHasMany

Returns a new instance of ShowHasMany.



20
21
22
23
# File 'app/views/resources/show_has_many.rb', line 20

def initialize(&config)
  @columns = []
  instance_eval(&config)
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



19
20
21
# File 'app/views/resources/show_has_many.rb', line 19

def columns
  @columns
end

Instance Method Details

#column(name, &block) ⇒ Object



25
26
27
# File 'app/views/resources/show_has_many.rb', line 25

def column(name, &block)
  self.columns << Column.new(name, &block)
end