Sha256: 7de5bf655eebf36585db7e22650e448df845f68e3ea302d92c39c084243e74b2
Contents?: true
Size: 958 Bytes
Versions: 36
Compression:
Stored size: 958 Bytes
Contents
module Inch module Evaluation # PriorityRange objects are used to associate a given # range of priorities with a symbol and an arrow. # class PriorityRange extend Utils::ReadWriteMethods extend Forwardable rw_methods %w(priorities arrow) def_delegators :priorities, :include?, :min, :max def initialize(symbol) @symbol = symbol end def update(&block) instance_eval(&block) end def to_sym @symbol end def to_s arrow end class << self attr_reader :priority_map def all @priority_map ||= {} @priority_map.values end def priority_range(symbol, &block) @priority_map ||= {} @priority_map[symbol] ||= PriorityRange.new(symbol) @priority_map[symbol].update(&block) if block @priority_map[symbol] end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems