Module: RhContext

Defined in:
lib/rh.rb

Overview

Recursive Hash context

Defined Under Namespace

Classes: ERBConfig

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.erbObject

Returns the value of attribute erb.



21
22
23
# File 'lib/rh.rb', line 21

def erb
  @erb
end

Class Method Details

.context=(data) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/rh.rb', line 50

def context=(data)
  @erb = ERBConfig.new if @erb.nil?

  @erb.context = data
rescue
  return
end

.data=(data) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/rh.rb', line 42

def data=(data)
  @erb = ERBConfig.new if @erb.nil?

  @erb.data = data
rescue
  return
end

.get(str) ⇒ Object



37
38
39
40
# File 'lib/rh.rb', line 37

def get(str)
  return str if @erb.nil?
  ERB.new(str).result(@erb.get_binding)
end