Sha256: 2c4a9807a1d2c9d3e5ff8ceab962db2ce543cbf70103e8dfc5382b91503adbe6

Contents?: true

Size: 409 Bytes

Versions: 6

Compression:

Stored size: 409 Bytes

Contents

module TableCloth
  class Action
    attr_reader :action, :options
    
    def initialize(options)
      @options = options
    end

    def available?(table)
      if options[:if] && options[:if].is_a?(Symbol)
        return !!table.send(options[:if])
      end

      if options[:unless] && options[:unless].is_a?(Symbol)
        return !table.send(options[:unless])
      end

      true
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
table_cloth-0.2.3 lib/table_cloth/action.rb
table_cloth-0.2.2 lib/table_cloth/action.rb
table_cloth-0.2.1 lib/table_cloth/action.rb
table_cloth-0.2.0 lib/table_cloth/action.rb
table_cloth-0.1.2 lib/table_cloth/action.rb
table_cloth-0.1.1 lib/table_cloth/action.rb