Sha256: 12a2dfa8bb9aa3b0cae4ff810f257ffcf4047e32ade00b3577832c167a6a5b14

Contents?: true

Size: 579 Bytes

Versions: 13

Compression:

Stored size: 579 Bytes

Contents

require 'rubygems'
require 'simple_service'

class ConcatName < SimpleService::Command
  expects :first_name, :last_name
  returns :name

  def call
    self.name = "#{first_name} #{last_name}"
  end
end

class CreateHelloString < SimpleService::Command
  expects :name
  returns :hello

  def call
    self.hello = "#{name}, say hello world!"
  end
end

class SayHello < SimpleService::Organizer
  expects :first_name, :last_name
  returns :hello
  commands ConcatName, CreateHelloString
end

result = SayHello.new(first_name: 'Ruby', last_name: 'Gem').call
puts result[:hello]

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
simple_service-1.4.1 example/hello_world.rb
simple_service-1.4.0 example/hello_world.rb
simple_service-1.3.91 example/hello_world.rb
simple_service-1.3.9 example/hello_world.rb
simple_service-1.3.8 example/hello_world.rb
simple_service-1.3.5 example/hello_world.rb
simple_service-1.3.4 example/hello_world.rb
simple_service-1.3.3 example/hello_world.rb
simple_service-1.3.2 example/hello_world.rb
simple_service-1.3.1 example/hello_world.rb
simple_service-1.3.0 example/hello_world.rb
simple_service-1.2.6 example/hello_world.rb
simple_service-1.2.5 example/hello_world.rb