Sha256: c3dc0daaf2ed350bab9dc423ddeeb069143557ec02f0b46d7afd3a9dcfd71ee5

Contents?: true

Size: 391 Bytes

Versions: 26

Compression:

Stored size: 391 Bytes

Contents

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

class Customer < RestModel
  property :name
  embeds_many :phones
end

class Phone < RestModel
  properties :number, :extension
end

@root = Customer.new({
  name: "Jackie Chan",
  phones: [
    {
      number: "2980319083",
      extension: "1398"
    },
    {
      number: "2979139332",
      extension: "1011"
    }
  ]})

inspect_rest_model(@root)

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rest_model-0.2.0 examples/initialize/embeds_many.rb
rest_model-0.1.24 examples/initialize/embeds_many.rb
rest_model-0.1.23 examples/initialize/embeds_many.rb
rest_model-0.1.22 examples/initialize/embeds_many.rb
rest_model-0.1.21 examples/initialize/embeds_many.rb
rest_model-0.1.20 examples/initialize/embeds_many.rb
rest_model-0.1.19 examples/initialize/embeds_many.rb
rest_model-0.1.18 examples/initialize/embeds_many.rb
rest_model-0.1.17 examples/initialize/embeds_many.rb
rest_model-0.1.16 examples/initialize/embeds_many.rb
rest_model-0.1.15 examples/initialize/embeds_many.rb
rest_model-0.1.14 examples/initialize/embeds_many.rb
rest_model-0.1.13 examples/initialize/embeds_many.rb
rest_model-0.1.12 examples/initialize/embeds_many.rb
rest_model-0.1.11 examples/initialize/embeds_many.rb
rest_model-0.1.10 examples/initialize/embeds_many.rb
rest_model-0.1.9 examples/initialize/embeds_many.rb
rest_model-0.1.8 examples/initialize/embeds_many.rb
rest_model-0.1.7 examples/initialize/embeds_many.rb
rest_model-0.1.6 examples/initialize/embeds_many.rb