module Lasershark
Constants
- VERSION
Public Class Methods
included(base)
click to toggle source
# File lib/lasershark.rb, line 7 def self.included(base) Interactor.class_eval do def initialize(context = {}) @context = new_context(context) end def new_context(context) if context_class context_class.build(context) elsif context.class.respond_to?(:build) context.class.build(context) else Interactor::Context.build(context) end end def context_class self.class.context_class end end base.class_eval do include Interactor extend ContextMethods end end
new(context = {})
click to toggle source
# File lib/lasershark.rb, line 9 def initialize(context = {}) @context = new_context(context) end
Public Instance Methods
context_class()
click to toggle source
# File lib/lasershark.rb, line 23 def context_class self.class.context_class end
new_context(context)
click to toggle source
# File lib/lasershark.rb, line 13 def new_context(context) if context_class context_class.build(context) elsif context.class.respond_to?(:build) context.class.build(context) else Interactor::Context.build(context) end end