module Construqt::Flavour

Public Class Methods

add(flavour) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 75
def self.add(flavour)
  Construqt.logger.info "setup flavour #{flavour.name}"
  @flavours[flavour.name.downcase] = FlavourDelegate.new(flavour)
end
add_aspect(aspect) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 81
def self.add_aspect(aspect)
  Construqt.logger.info "setup aspect #{aspect.name}"
  @aspects << aspect
end
call_aspects(type, *args) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 90
def self.call_aspects(type, *args)
  @aspects.each { |aspect| aspect.call(type, *args) }
end
del_aspect(aspect) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 86
def self.del_aspect(aspect)
  @aspects = @aspects.select{|a| a.name != aspect }
end
find(name) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 94
def self.find(name)
  ret = @flavours[name.downcase]
  throw "flavour #{name} not found" unless ret
  ret
end
parser(flavour, dialect, prefix = nil) click to toggle source
# File lib/construqt/flavour/flavour.rb, line 100
def self.parser(flavour, dialect, prefix = nil)
  @flavours[flavour].flavour::Result.new(OpenStruct.new(:dialect => dialect, :fname => prefix, :interfaces => {}))
end