Sha256: c72573f35f1a49268bf410d7bd0863b420210449176c4d372e8a191d7f20681e
Contents?: true
Size: 686 Bytes
Versions: 13
Compression:
Stored size: 686 Bytes
Contents
require 'rubygems' require 'simple_service' class Increment < SimpleService::Command expects :counter returns :counter def execute self.counter += 1 end end class IncrementCounter < SimpleService::Organizer expects :counter returns :counter commands Increment, Increment, Increment end class ReallyIncrementThatCounter < SimpleService::Organizer expects :counter returns :counter commands IncrementCounter, IncrementCounter, IncrementCounter end result = IncrementCounter.new(counter: 0).execute puts "IncrementCounter: #{result[:counter]}" result = ReallyIncrementThatCounter.new(counter: 0).execute puts "ReallyIncrementThatCounter: #{result[:counter]}"
Version data entries
13 entries across 13 versions & 1 rubygems