Sha256: b8f525b2d9e729d64fb23b2572cf04da38d173de79369eba3f9273b0894fce5d

Contents?: true

Size: 687 Bytes

Versions: 27

Compression:

Stored size: 687 Bytes

Contents

module Foobara
  class Command
    module Concerns
      module ResultType
        include Concern

        module ClassMethods
          def result(...)
            @result_type = type_for_declaration(...)
          end

          def result_type
            return @result_type if defined?(@result_type)

            @result_type = if superclass < Foobara::Command
                             superclass.result_type
                           end
          end

          def raw_result_type_declaration
            result_type.raw_declaration_data
          end
        end

        foobara_delegate :result_type, :raw_result_type_declaration, to: :class
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
foobara-0.0.7 projects/command/src/concerns/result_type.rb
foobara-0.0.6 projects/command/src/concerns/result_type.rb
foobara-0.0.5 projects/command/src/concerns/result_type.rb
foobara-0.0.4 projects/command/src/concerns/result_type.rb
foobara-0.0.3 projects/command/src/concerns/result_type.rb
foobara-0.0.2 projects/command/src/concerns/result_type.rb
foobara-0.0.1 projects/command/src/concerns/result_type.rb