Class: TableCloth::Extensions::Actions::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/table_cloth/extensions/actions/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Action

Returns a new instance of Action.



5
6
7
# File 'lib/table_cloth/extensions/actions/action.rb', line 5

def initialize(options={})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/table_cloth/extensions/actions/action.rb', line 3

def options
  @options
end

Instance Method Details

#juryObject



9
10
11
# File 'lib/table_cloth/extensions/actions/action.rb', line 9

def jury
  @jury ||= Jury.new(self)
end

#value(object, view, table) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/table_cloth/extensions/actions/action.rb', line 13

def value(object, view, table)
  if jury.available?(object, table)
    view.instance_exec(object, &options[:proc])
  else
    ""
  end
end