Sha256: 0b1ad926b809bf384e8a5bbc7818e78d6d5da0cc4aef7b05aa1739ce703ba8aa

Contents?: true

Size: 931 Bytes

Versions: 4

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Standard
      module V1
        class Cowsay
          module Services
            class BuildCow
              include ConvenientService::Standard::V1::Config

              def result
                success(cow: cow)
              end

              private

              ##
              # Copied with ❤️ from https://github.com/gaborbata/rosetta-cow
              #
              def cow
                <<~'HEREDOC'.split("\n").map { |line| offset(line) }.join("\n")
                  \   ^__^
                   \  (oo)\_______
                      (__)\       )\/\
                          ||----w |
                          ||     ||
                HEREDOC
              end

              def offset(line)
                " " * 10 + line
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb
convenient_service-0.16.0 lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb
convenient_service-0.15.0 lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb
convenient_service-0.14.0 lib/convenient_service/examples/standard/v1/cowsay/services/build_cow.rb