Class: Alchemy::Admin::Resource::Cell

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/admin/resource/cell.rb

Overview

Renders a table cell with the given css classes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(css_classes, &block) ⇒ Cell

Returns a new instance of Cell.



22
23
24
25
# File 'app/components/alchemy/admin/resource/cell.rb', line 22

def initialize(css_classes, &block)
  @css_classes = css_classes
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



14
15
16
# File 'app/components/alchemy/admin/resource/cell.rb', line 14

def block
  @block
end

#css_classesObject (readonly)

Returns the value of attribute css_classes.



14
15
16
# File 'app/components/alchemy/admin/resource/cell.rb', line 14

def css_classes
  @css_classes
end

Instance Method Details

#with_resource(resource) ⇒ Object



27
28
29
30
# File 'app/components/alchemy/admin/resource/cell.rb', line 27

def with_resource(resource)
  @resource = resource
  self
end