Sha256: 9eaf77578a58530182ef597c0f854bb5286c1a3fda6f83bdb199333b4749ff87

Contents?: true

Size: 403 Bytes

Versions: 32

Compression:

Stored size: 403 Bytes

Contents

require "rubygems"
require "diy"

class Car
  attr_reader :engine, :chassis
  def initialize(arg_hash)
    @engine = arg_hash[:engine]
    @chassis = arg_hash[:chassis]
  end
end

class Chassis
  def to_s
    "Chassis"
  end
end

class Engine
  def to_s
    "Engine"
  end
end

context = DIY::Context.from_file("objects.yml")
car = context['car']
puts "Car is made of: #{car.engine} and #{car.chassis}"

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
ceedling-0.31.1 vendor/diy/sample_code/diy_example.rb
ceedling-0.31.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.30.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.28.3 vendor/diy/sample_code/diy_example.rb
ceedling-0.28.2 vendor/diy/sample_code/diy_example.rb
ceedling-0.28.1 vendor/diy/sample_code/diy_example.rb
ceedling-0.27.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.25.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.24.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.22.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.21.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.20.3 vendor/diy/sample_code/diy_example.rb
ceedling-0.20.2 vendor/diy/sample_code/diy_example.rb
ceedling-0.19.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.18.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.17.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.16.0 vendor/diy/sample_code/diy_example.rb
ceedling-0.15.6 vendor/diy/sample_code/diy_example.rb
ceedling-0.15.5 vendor/diy/sample_code/diy_example.rb
ceedling-0.15.4 vendor/diy/sample_code/diy_example.rb