Class: CPEE::AttributesHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/cpee/controller.rb

Overview

{{{

Instance Method Summary collapse

Instance Method Details

#attributesObject



46
47
48
# File 'lib/cpee/controller.rb', line 46

def attributes
  @attributes
end

#dataObject



38
39
40
# File 'lib/cpee/controller.rb', line 38

def data
  @data
end

#endpointsObject



42
43
44
# File 'lib/cpee/controller.rb', line 42

def endpoints
  @endpoints
end

#translate(__attributes__, __dataelements__, __endpoints__) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/cpee/controller.rb', line 27

def translate(__attributes__,__dataelements__,__endpoints__)
  @data       = WEEL::ReadHash.new(__dataelements__)
  @endpoints  = WEEL::ReadHash.new(__endpoints__)
  @attributes = WEEL::ReadHash.new(__attributes__)
  __attributes__.transform_values do |v|
    v.gsub(/(!(attributes|data|endpoints)\.[\w_]+)/) do |m|
      eval(m[1..-1])
    end
  end
end