Class: Inch::Evaluation::PriorityRange
- Inherits:
-
Object
- Object
- Inch::Evaluation::PriorityRange
- Extended by:
- Forwardable, Utils::ReadWriteMethods
- Defined in:
- lib/inch/evaluation/priority_range.rb
Class Attribute Summary collapse
-
.priority_map ⇒ Object
readonly
Returns the value of attribute priority_map.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(symbol) ⇒ PriorityRange
constructor
A new instance of PriorityRange.
- #to_s ⇒ Object
- #to_sym ⇒ Object
- #update(&block) ⇒ Object
Methods included from Utils::ReadWriteMethods
Constructor Details
#initialize(symbol) ⇒ PriorityRange
Returns a new instance of PriorityRange.
11 12 13 |
# File 'lib/inch/evaluation/priority_range.rb', line 11 def initialize(symbol) @symbol = symbol end |
Class Attribute Details
.priority_map ⇒ Object (readonly)
Returns the value of attribute priority_map.
28 29 30 |
# File 'lib/inch/evaluation/priority_range.rb', line 28 def priority_map @priority_map end |
Class Method Details
.all ⇒ Object
30 31 32 33 |
# File 'lib/inch/evaluation/priority_range.rb', line 30 def all @priority_map ||= {} @priority_map.values end |
.priority_range(symbol, &block) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/inch/evaluation/priority_range.rb', line 35 def priority_range(symbol, &block) @priority_map ||= {} @priority_map[symbol] ||= PriorityRange.new(symbol) @priority_map[symbol].update(&block) if block @priority_map[symbol] end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/inch/evaluation/priority_range.rb', line 23 def to_s arrow end |
#to_sym ⇒ Object
19 20 21 |
# File 'lib/inch/evaluation/priority_range.rb', line 19 def to_sym @symbol end |
#update(&block) ⇒ Object
15 16 17 |
# File 'lib/inch/evaluation/priority_range.rb', line 15 def update(&block) instance_eval(&block) end |