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.1.5 examples/initialize/embeds_many.rb
rest_model-0.1.4 examples/initialize/embeds_many.rb
rest_model-0.1.3 examples/initialize/embeds_many.rb
rest_model-0.1.2 examples/initialize/embeds_many.rb
rest_model-0.1.1 examples/initialize/embeds_many.rb
rest_model-0.1.0 examples/initialize/embeds_many.rb