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.7 lib/cpee/attributes_helper.rb
cpee-2.0.6 lib/cpee/attributes_helper.rb
cpee-2.0.5 lib/cpee/attributes_helper.rb
cpee-2.0.3 lib/cpee/attributes_helper.rb
cpee-2.0.2 lib/cpee/attributes_helper.rb
cpee-2.0.1 lib/cpee/attributes_helper.rb
cpee-2.0 lib/cpee/attributes_helper.rb