Class: Inch::Evaluation::PriorityRange

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, Utils::ReadWriteMethods
Defined in:
lib/inch/evaluation/priority_range.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::ReadWriteMethods

rw_method, rw_methods

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_mapObject (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

.allObject



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_sObject



23
24
25
# File 'lib/inch/evaluation/priority_range.rb', line 23

def to_s
  arrow
end

#to_symObject



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