Sha256: 2aa503fddc3bd0c08ff9265cb680bc0c6c70df46974f1e03e727b629ef156cfb

Contents?: true

Size: 404 Bytes

Versions: 6

Compression:

Stored size: 404 Bytes

Contents

require 'json'

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

class Item < Transcriber::Resource
  property :id, field: :item_id
end

class Root < Transcriber::Resource
  embeds_many :items, start_key: 'detalhe.itens'
end

@root = Root.parse({"detalhe" => {"itens" => [{"item_id" => 2000}]}}).first

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
transcriber-0.0.9 examples/embeds_many/with_start_key.rb
transcriber-0.0.8 examples/embeds_many/with_start_key.rb
transcriber-0.0.7 examples/embeds_many/with_start_key.rb
transcriber-0.0.6 examples/embeds_many/with_start_key.rb
transcriber-0.0.5 examples/embeds_many/with_start_key.rb
transcriber-0.0.4 examples/embeds_many/with_start_key.rb