Sha256: cfe018cb5171187ee0bb4c8e4c17d7cebda011f7f633f14ee8c3552f141cce03

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

module CanTango
  module PermissionEngine
    module Parser
      class Rule

        attr_reader :method, :action, :model, :target

        def initialize method, action, target
          @target = target
          @method = method
          @action = action
        end

        def parse
        end

        def parse_class target = nil
          @target = target if target
          try_class.to_s
        end

        def try_class
          target.constantize
        rescue
          raise "[permission] target #{target} does not have a class so it was skipped"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-0.8.0 lib/cantango/permission_engine/parser/rule.rb