Class: TableCloth::Extensions::Actions::Jury
- Inherits:
-
Object
- Object
- TableCloth::Extensions::Actions::Jury
- Defined in:
- lib/table_cloth/extensions/actions/jury.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Instance Method Summary collapse
- #available?(object) ⇒ Boolean
-
#initialize(action) ⇒ Jury
constructor
A new instance of Jury.
Constructor Details
#initialize(action) ⇒ Jury
Returns a new instance of Jury.
5 6 7 |
# File 'lib/table_cloth/extensions/actions/jury.rb', line 5 def initialize(action) @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/table_cloth/extensions/actions/jury.rb', line 3 def action @action end |
Instance Method Details
#available?(object) ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/table_cloth/extensions/actions/jury.rb', line 9 def available?(object) case action_if when Proc return !!action_if.call(object) when Symbol return !!object.send(action_if) end case action_unless when Proc return !action_unless.call(object) when Symbol return !object.send(action_unless) end return true end |