Module: Wits::FinalInterimPrices::ConvenienceMethods

Included in:
Wits::FinalInterimPrices
Defined in:
lib/wits/final_interim_prices/convenience_methods.rb

Class Method Summary collapse

Class Method Details

.extended(_base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/wits/final_interim_prices/convenience_methods.rb', line 7

def self.extended(_base)
  Wits::Nodes.nodes.each do |node, name|
    # def ben2201
    create_prices_method(node.downcase, node)

    # def hay
    create_prices_method(node.downcase[0..2], node)

    # def halfway_bush
    create_prices_method(name.downcase.tr(' ', '_'), node)


    # def ben2201_prices
    create_prices_method("#{node.downcase}_prices", node)

    # def hay_prices
    create_prices_method("#{node.downcase[0..2]}_prices", node)

    # def halfway_bush_prices
    create_prices_method("#{name.downcase.tr(' ', '_')}_prices", node)
  end
end