Sha256: 7277fde5addd69528ab7c2b61839510023237383bfded846b6b7e1ee89382287

Contents?: true

Size: 627 Bytes

Versions: 6

Compression:

Stored size: 627 Bytes

Contents

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

class Service < Transcriber::Resource
  property :name
  belongs_to :customer
end

class Billing < Transcriber::Resource
  property :login
  belongs_to :customer
end

class Developer < Transcriber::Resource
  property :login
  belongs_to :customer
end

class Customer < Transcriber::Resource
  id field: :customer_id, type: Integer
  property :login
  has_many :services
  has_one :billing
  has_one :devops, class_name: :developer
end

@root = Customer.parse({"customer_id" => 123, "login" => 'jackiechan2010'}).first

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
transcriber-0.0.9 examples/has_many/simple.rb
transcriber-0.0.8 examples/has_many/simple.rb
transcriber-0.0.7 examples/has_many/simple.rb
transcriber-0.0.6 examples/has_many/simple.rb
transcriber-0.0.5 examples/has_many/simple.rb
transcriber-0.0.4 examples/has_many/simple.rb