Sha256: 2afa6be5b96c9c8fa24149e1fb296a4091ec3dc40fc208e7200a9ea3a6fd2f75

Contents?: true

Size: 396 Bytes

Versions: 16

Compression:

Stored size: 396 Bytes

Contents

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

class Billing < RestModel
  property :login
  belongs_to :customer
end

class Customer < RestModel
  id field: :customer_id, type: Integer
  property :login
  has_one  :billing, href: proc {"http://external.service.com/customers/#{id}/billing"}
end

@root = Customer.from_source!({customer_id: 123, login: 'jackiechan2010'}).first

inspect_rest_model(@root)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rest_model-0.3.1 examples/has_one/href_options.rb
rest_model-0.3.0 examples/has_one/href_options.rb
rest_model-0.2.3 examples/has_one/href_options.rb
rest_model-0.2.1 examples/has_one/href_options.rb
rest_model-0.2.0 examples/has_one/href_options.rb
rest_model-0.1.24 examples/has_one/href_options.rb
rest_model-0.1.23 examples/has_one/href_options.rb
rest_model-0.1.22 examples/has_one/href_options.rb
rest_model-0.1.21 examples/has_one/href_options.rb
rest_model-0.1.20 examples/has_one/href_options.rb
rest_model-0.1.19 examples/has_one/href_options.rb
rest_model-0.1.18 examples/has_one/href_options.rb
rest_model-0.1.17 examples/has_one/href_options.rb
rest_model-0.1.16 examples/has_one/href_options.rb
rest_model-0.1.15 examples/has_one/href_options.rb
rest_model-0.1.14 examples/has_one/href_options.rb