Sha256: 77dff99a1ffdd560c62bc61f9be727b202ba5a1883337b1e4df1191a48a4c4ca

Contents?: true

Size: 520 Bytes

Versions: 4

Compression:

Stored size: 520 Bytes

Contents

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

class Customer < RestModel
  convert_input_keys proc {|keys| keys}

  id
  properties :login, :name, :postal_code, :email, :secondary_email
  summarizes :id, :login
end

input = {
  "id"              => 138911938,
  "login"           => 'jackiechan2010',
  "name"            => 'jackie chan',
  "postal_code"     => '05492-092',
  "email"           => 'jachan@gmail.com',
  "secondary_email" => 'jackiepeligroso@yahoo.com'
}

@root = Customer.resources Customer.from_source!(input)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rest_model-0.3.1 examples/summarization/simple.rb
rest_model-0.3.0 examples/summarization/simple.rb
rest_model-0.2.3 examples/summarization/simple.rb
rest_model-0.2.1 examples/summarization/simple.rb