Module: Qipowl

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

Overview

Author:

  • Alexei Matyushkin

Defined Under Namespace

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

Constant Summary collapse

VERSION =
"0.9.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.tg__htmlObject



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

def self.tg__html
  Html.new
end

.tg_md__htmlObject



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

def self.tg_md__html
  result = tg__html
  result.merge_rules "#{File.dirname(__FILE__)}/tagmaps/markdown2html.yaml"
  result
end

Instance Method Details

#config(&block) ⇒ Object

A wrapper for the configuration block



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

def config &block
  instance_eval(&block)
end

#params(*names) ⇒ Object

Basic single-method DSL with .parameter method being used to define a set of available settings. This method takes one or more symbols, with each one being a name of the configuration option.



21
22
23
24
25
26
27
28
29
# File 'lib/qipowl.rb', line 21

def params *names
  names.each do |name|
    attr_accessor name
    define_method name do |*values|
      value = values.first
      value ? self.send("#{name}=", value) : instance_variable_get("@#{name}")
    end
  end
end