Sha256: 446171620592ca83e68d6e989d50fd31c94a32d6417efc57a9b7a38404ed5cb9
Contents?: true
Size: 609 Bytes
Versions: 7
Compression:
Stored size: 609 Bytes
Contents
# encoding: utf-8 $:.push 'lib'; require 'transcriber' class Root < Transcriber::Resource property :key, id: true property :locale, visible: false embeds_many :names, class_name: 'Hash', visible: false property :name, values: proc {names[locale]} end @root = Root.parse({'locale' => 'pt-BR', 'key' => 19190839, 'names' => { 'en' => 'Woot', 'pt-BR' => 'Úia', 'es' => 'Me gusta' }}).first puts "root: #{@root.inspect}" puts "resource: #{@root.resource}"
Version data entries
7 entries across 7 versions & 1 rubygems