Sha256: 053b746e2aa076abb6562fc8fd7478aa7c4474c2e5ead1aaf9c7075504e5ff51

Contents?: true

Size: 520 Bytes

Versions: 3

Compression:

Stored size: 520 Bytes

Contents

module Cp8Cli
  class BranchName
    def initialize(user:, target:, title:, short_link: nil)
      @user = user
      @target = target
      @title = title
      @short_link = short_link
    end

    def to_s
      parts.join(".")
    end

    private

      attr_reader :user, :target, :title, :short_link

      def parts
        parts = []
        parts << user.initials.downcase
        parts << title.parameterize[0..50]
        parts << target
        parts << short_link
        parts.compact
      end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cp8_cli-6.0.1 lib/cp8_cli/branch_name.rb
cp8_cli-6.0.0 lib/cp8_cli/branch_name.rb
cp8_cli-5.0.0 lib/cp8_cli/branch_name.rb