Module: Qipowl

Extended by:
Qipowl
Included in:
Qipowl
Defined in:
lib/qipowl/core/ruler.rb,
lib/qipowl.rb,
lib/qipowl/version.rb,
lib/qipowl/constants.rb,
lib/qipowl/bowlers/html.rb,
lib/qipowl/bowlers/yaml.rb,
lib/qipowl/bowlers/i_sp_ru.rb,
lib/qipowl/core/monkeypatches.rb

Overview

Author:

  • Alexei Matyushkin

Defined Under Namespace

Modules: Bowlers, Mappers, Ruler Classes: Html, Yaml

Constant Summary collapse

VERSION =
"0.9.7"
BTRACE_COUNT =
6
ENTITIES =
%w(block alone magnet grip regular self)

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args) ⇒ Object (private)



44
45
46
47
48
49
50
# File 'lib/qipowl.rb', line 44

def method_missing(sym, *args)
  if sym.to_s =~ /(.+)=$/
    config[$1.to_sym] = args.first
  else
    config[sym.to_sym]
  end
end

Instance Method Details

#[](key) ⇒ Object



26
27
28
# File 'lib/qipowl.rb', line 26

def [](key)
  config[key.to_sym]
end

#add(key, value) ⇒ Object (private)



36
37
38
# File 'lib/qipowl.rb', line 36

def add(key, value)
  config[key.to_sym] = [*config[key.to_sym]] << value
end

#configObject (private)



40
41
42
# File 'lib/qipowl.rb', line 40

def config
  @config ||= Hash.new
end

#configure(&block) ⇒ Object

A wrapper for the configuration block



22
23
24
# File 'lib/qipowl.rb', line 22

def configure &block
  instance_eval(&block)
end

#set(key, value) ⇒ Object (private)



32
33
34
# File 'lib/qipowl.rb', line 32

def set(key, value)
  config[key.to_sym] = value
end