Sha256: e70e2201da637ccd5549a6bbace292b3304eca9b4d0d716fa2013b6e8e1646a7
Contents?: true
Size: 390 Bytes
Versions: 1
Compression:
Stored size: 390 Bytes
Contents
# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path("../lib", __dir__) require "voltage" class Contact include Voltage.call attr_reader :name, :email def initialize(name, email) @name = name @email = email end def call emit(:output, self) end end Contact.call("John", "john@example.com") do |o| o.on(:output) {|contact| puts contact.name } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
voltage-0.1.0 | examples/call.rb |