Class: AttributesHelper

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

Instance Method Summary collapse

Instance Method Details

#attributesObject



23
24
25
# File 'lib/cpee/attributes_helper.rb', line 23

def attributes
  @attributes
end

#dataObject



15
16
17
# File 'lib/cpee/attributes_helper.rb', line 15

def data
  @data
end

#endpointsObject



19
20
21
# File 'lib/cpee/attributes_helper.rb', line 19

def endpoints
  @endpoints
end

#translate(__attributes__, __dataelements__, __endpoints__) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/cpee/attributes_helper.rb', line 4

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