Sha256: 20d823fd09a301c6afd1d1b2c3906ad2110d9a990e7b8e2b0b0983542c90d892
Contents?: true
Size: 1.72 KB
Versions: 6
Compression:
Stored size: 1.72 KB
Contents
# frozen_string_literal: true module ConvenientService module Service module Plugins module HasResultSteps module Entities class Method module Commands ## # TODO: Abstract factory. # class CastMethodDirection < Support::Command attr_reader :other, :options def initialize(other:, options:) @other = other @options = options end def call casted = case options[:direction] when ::Symbol then cast_symbol when ::String then cast_string end ## # TODO: Specs. Priority. # return casted if casted case other when Method then cast_method end end private def cast_symbol case options[:direction] when :input Entities::Directions::Input.new when :output Entities::Directions::Output.new end end def cast_string case options[:direction] when "input" Entities::Directions::Input.new when "output" Entities::Directions::Output.new end end def cast_method other.direction.copy end end end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems