Module: Bang

Defined in:
lib/bang.rb

Defined Under Namespace

Modules: ExceptionExtension, MethodMissing, NumericMixin, ObjectMixin, ProcMixin Classes: Assertion

Class Method Summary collapse

Class Method Details

.const_missing(const_name) ⇒ Object

If constant is missing check for value in project metadata. e.g. ‘Bang::VERSION`.



10
11
12
# File 'lib/bang.rb', line 10

def self.const_missing(const_name)
  index[const_name.to_s.downcase] || super(const_name)
end

.indexObject

Access project metadata.



17
18
19
20
21
22
# File 'lib/bang.rb', line 17

def self.index
  @index ||= (
    require 'yaml'
    YAML.load_file(File.dirname(__FILE__) + '/bang.yml')
  )
end