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.3.1 examples/embeds_many/invisible.rb
rest_model-0.3.0 examples/embeds_many/invisible.rb
rest_model-0.2.3 examples/embeds_many/invisible.rb
rest_model-0.2.1 examples/embeds_many/invisible.rb
rest_model-0.2.0 examples/embeds_many/invisible.rb
rest_model-0.1.24 examples/embeds_many/invisible.rb
rest_model-0.1.23 examples/embeds_many/invisible.rb
rest_model-0.1.22 examples/embeds_many/invisible.rb
rest_model-0.1.21 examples/embeds_many/invisible.rb
rest_model-0.1.20 examples/embeds_many/invisible.rb
rest_model-0.1.19 examples/embeds_many/invisible.rb
rest_model-0.1.18 examples/embeds_many/invisible.rb
rest_model-0.1.17 examples/embeds_many/invisible.rb
rest_model-0.1.16 examples/embeds_many/invisible.rb
rest_model-0.1.15 examples/embeds_many/invisible.rb
rest_model-0.1.14 examples/embeds_many/invisible.rb
rest_model-0.1.13 examples/embeds_many/invisible.rb
rest_model-0.1.12 examples/embeds_many/invisible.rb
rest_model-0.1.11 examples/embeds_many/invisible.rb
rest_model-0.1.10 examples/embeds_many/invisible.rb