Sha256: 02c970c18e6f72dc510413dffade9b303812641b4fb888c88965721ce83affe1

Contents?: true

Size: 458 Bytes

Versions: 18

Compression:

Stored size: 458 Bytes

Contents

$:.push 'lib'; require 'transcriber'

class Customer < Transcriber::Resource
  property :name
  embeds_many :phones
end

class Phone < Transcriber::Resource
  properties :number, :extension
end

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

puts "root:     #{@root.inspect}"
puts "resource: #{@root.resource}"

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
transcriber-0.0.26 examples/initialize/embeds_many.rb
transcriber-0.0.25 examples/initialize/embeds_many.rb
transcriber-0.0.24 examples/initialize/embeds_many.rb
transcriber-0.0.23 examples/initialize/embeds_many.rb
transcriber-0.0.22 examples/initialize/embeds_many.rb
transcriber-0.0.21 examples/initialize/embeds_many.rb
transcriber-0.0.20 examples/initialize/embeds_many.rb
transcriber-0.0.19 examples/initialize/embeds_many.rb
transcriber-0.0.18 examples/initialize/embeds_many.rb
transcriber-0.0.17 examples/initialize/embeds_many.rb
transcriber-0.0.16 examples/initialize/embeds_many.rb
transcriber-0.0.15 examples/initialize/embeds_many.rb
transcriber-0.0.14 examples/initialize/embeds_many.rb
transcriber-0.0.13 examples/initialize/embeds_many.rb
transcriber-0.0.12 examples/initialize/embeds_many.rb
transcriber-0.0.11 examples/initialize/embeds_many.rb
transcriber-0.0.10 examples/initialize/embeds_many.rb
transcriber-0.0.9 examples/initialize/embeds_many.rb