Sha256: ae21de571419f957afdc559d6478f6bba9114f1c5d357d40a6185a9a5675cb0b

Contents?: true

Size: 633 Bytes

Versions: 1

Compression:

Stored size: 633 Bytes

Contents

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

Transcriber.configure do |c|
  c.true_value = "X"
  c.false_value = ""
  c.date_format = "%Y%m%d"
end

class Customer < Transcriber::Resource
  property :login
  property :age,      type: Integer
  property :birth,    type: Date
  property :active,   type: Boolean
  property :services, type: Enumerable
  property :balance,  type: Float
end

@root = Customer.new({login: 'jackiechan2010', age: 22, birth: "1990-07-04", active: true, services: ["Hosting", "Email"], balance: 200.00})

puts "root.to_input: #{@root.to_input}"

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transcriber-0.0.26 examples/to_input/serializables.rb