Sha256: 67c38bc2dd539f6deb4f5a57e6d94a14f2b0727b1572dad71e99208b76f6d1eb

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

# =========================================================================
#   Ceedling - Test-Centered Build System for C
#   ThrowTheSwitch.org
#   Copyright (c) 2010-24 Mike Karlesky, Mark VanderVoord, & Greg Williams
#   SPDX-License-Identifier: MIT
# =========================================================================


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

2 entries across 2 versions & 1 rubygems

Version Path
ceedling-1.0.1 vendor/diy/sample_code/diy_example.rb
ceedling-1.0.0 vendor/diy/sample_code/diy_example.rb