Sha256: 9654c5cc25e5b55df0bfe617d469751807eaef295d5568b169c3fafec3601584

Contents?: true

Size: 525 Bytes

Versions: 27

Compression:

Stored size: 525 Bytes

Contents

require 'weel'

class AttributesHelper
  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

  def data
    @data
  end

  def endpoints
    @endpoints
  end

  def attributes
    @attributes
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cpee-2.0.30 lib/cpee/attributes_helper.rb
cpee-2.0.28 lib/cpee/attributes_helper.rb
cpee-2.0.27 lib/cpee/attributes_helper.rb
cpee-2.0.26 lib/cpee/attributes_helper.rb
cpee-2.0.25 lib/cpee/attributes_helper.rb
cpee-2.0.24 lib/cpee/attributes_helper.rb
cpee-2.0.23 lib/cpee/attributes_helper.rb
cpee-2.0.22 lib/cpee/attributes_helper.rb
cpee-2.0.21 lib/cpee/attributes_helper.rb
cpee-2.0.20 lib/cpee/attributes_helper.rb
cpee-2.0.19 lib/cpee/attributes_helper.rb
cpee-2.0.18 lib/cpee/attributes_helper.rb
cpee-2.0.17 lib/cpee/attributes_helper.rb
cpee-2.0.16 lib/cpee/attributes_helper.rb
cpee-2.0.15 lib/cpee/attributes_helper.rb
cpee-2.0.14 lib/cpee/attributes_helper.rb
cpee-2.0.13 lib/cpee/attributes_helper.rb
cpee-2.0.11 lib/cpee/attributes_helper.rb
cpee-2.0.9 lib/cpee/attributes_helper.rb
cpee-2.0.8 lib/cpee/attributes_helper.rb