Sha256: 8b7fec2ada19088dd2f1c08bd35065eb357a2e925e18b74228b24568ab484318

Contents?: true

Size: 872 Bytes

Versions: 7

Compression:

Stored size: 872 Bytes

Contents

$:.push 'examples'; require 'helper'

RestModel::Configuration.configure do |c|
  c.true_value = "X"
  c.false_value = ""
  c.date_format = "%Y%m%d"
  c.date_time_format = "%a %b %d %H:%M:%S %Y"
end

class Customer < RestModel
  property :login
  property :age,        type: Integer
  property :birth,      type: Date
  property :created_at, type: DateTime
  property :active,     type: Boolean
  property :services,   type: Enumerable
  property :balance,    type: Float
  property :sym,        type: Symbol
end

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

inspect_rest_model(@root)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rest_model-0.3.1 examples/to_source/serializables.rb
rest_model-0.3.0 examples/to_source/serializables.rb
rest_model-0.2.3 examples/to_source/serializables.rb
rest_model-0.2.1 examples/to_source/serializables.rb
rest_model-0.2.0 examples/to_source/serializables.rb
rest_model-0.1.24 examples/to_source/serializables.rb
rest_model-0.1.23 examples/to_source/serializables.rb