Module: SVF

Defined in:
lib/svf.rb,
lib/svf/cell.rb,
lib/svf/line.rb,
lib/svf/formater.rb,
lib/svf/occurrence.rb

Defined Under Namespace

Classes: Cell, Formater, InvalidSyntax, Line, Occurrence

Class Method Summary collapse

Class Method Details

.load(name, file) ⇒ Object

Build submodule to handle format defined in the file Format must be defined in YAML


13
14
15
# File 'lib/svf.rb', line 13

def load(name, file)
  module_eval(Formater.new(name, file).generate)
end

.norms_pathObject

Returns the default path where the norms are loaded


29
30
31
# File 'lib/svf.rb', line 29

def norms_path
  Pathname.new(__FILE__).dirname.join('svf', 'norms')
end

.occurrencify(array) ⇒ Object

Convert an array of items to an array of occurrences


18
19
20
21
22
23
24
25
26
# File 'lib/svf.rb', line 18

def occurrencify(array)
  occurrences = []
  array.each do |items|
    items.each do |name, definition|
      occurrences << SVF::Occurrence.new(name, definition)
    end
  end
  occurrences
end