Sha256: 72b137685acfe28f9e03f0b0354e5ee5d1bdfb64c8e9a13ae0213476c419b56e

Contents?: true

Size: 519 Bytes

Versions: 17

Compression:

Stored size: 519 Bytes

Contents

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

class Item < Transcriber::Resource
  property :id
end

class Root < Transcriber::Resource
  property :id
  embeds_many :items, if: proc {id == "10"}
end

@root_with_items = Root.parse({id: 10, items: [{id: 2000}]}).first

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


@root_without_items = Root.parse({id: 1, items: [{id: 2000}]}).first

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

Version data entries

17 entries across 17 versions & 1 rubygems

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