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