Sha256: 16fdd0fc2fbc6132a8051a5e004f3ff83b3b1c6da8d46ac0634101f2e08f3ae4
Contents?: true
Size: 412 Bytes
Versions: 2
Compression:
Stored size: 412 Bytes
Contents
module Ostiary class Policy attr_reader :name, :method, :actions def initialize(name, actions = [], method: nil) @name = name @method = method @actions = actions end def inspect "#{name}" end def met?(_action) return yield name unless method method.call end def error_message(action) "#{action} requires #{name}" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ostiary-0.11.0 | lib/ostiary/policy.rb |
ostiary-0.10.0 | lib/ostiary/policy.rb |