Sha256: 773cc6556c589425d0be1522217d1849427c2739f0cca994ff9730fbc39d3748

Contents?: true

Size: 398 Bytes

Versions: 21

Compression:

Stored size: 398 Bytes

Contents

module CanTango
  class PermissionEngine < Engine
    class Statement
      attr_reader :method, :action, :conditions

      def initialize method, action, conditions = {}
        @method, @action, @conditions = [method, action, conditions]
      end

      def to_code
        line = conditions.empty? ? "#{method}(:#{action})" : "#{method}(:#{action}, #{conditions})"
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cantango-0.8.5.1 lib/cantango/permission_engine/statement.rb