This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'java' | |
| require 'scala-library.jar' | |
| require 'config-1.0.0.jar' | |
| require 'akka-actor_2.10-2.1.0.jar' | |
| java_import 'java.io.Serializable' | |
| java_import 'akka.actor.UntypedActor' | |
| java_import 'akka.actor.ActorRef' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DCI example where a single user has two roles | |
| class AuthorizeEmployeeDiscount | |
| attr_accessor :employee, :manager | |
| def self.execute(employee_user_id, manager_user_id) | |
| AuthorizeEmployeeDiscount.new(employee_user_id, manager_user_id).execute | |
| end | |
| def initialize(employee_user_id, manager_user_id) | |
| @employee = User.find(employee_user_id) |
NewerOlder