Sha256: 85152de094ac939d3068a93c3e362e104821cc77a06468ac0860d66f0c91ef2e

Contents?: true

Size: 473 Bytes

Versions: 25

Compression:

Stored size: 473 Bytes

Contents

# encoding: utf-8

$:.push 'examples'; require 'helper'

class Root < RestModel
  property    :key,    id: true
  property    :locale, visible: false
  embeds_many :names,  class_name: 'Hash', visible: false
  property    :name,   from_source: proc {names[locale]}, to_source: proc {names[locale]}
end

names = {'en' => 'Woot', 'pt-BR' => 'Úia', 'es' => 'Me gusta'}

@root = Root.from_source!(locale: 'pt-BR', key: 19190839, names: names).first

inspect_rest_model(@root)

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rest_model-0.1.9 examples/embeds_many/invisible.rb
rest_model-0.1.8 examples/embeds_many/invisible.rb
rest_model-0.1.7 examples/embeds_many/invisible.rb
rest_model-0.1.6 examples/embeds_many/invisible.rb
rest_model-0.1.5 examples/embeds_many/invisible.rb