Sha256: 7f066f03df6050777422ac9c83b148437c0046a70a177f56c598e6f0b388a937
Contents?: true
Size: 429 Bytes
Versions: 2
Compression:
Stored size: 429 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ceedling-0.29.1 | vendor/diy/sample_code/diy_example.rb |
ceedling-0.29.0 | vendor/diy/sample_code/diy_example.rb |