Sha256: fde0baf353d34b2c78db4e35b4615f87d0b16a37dff8fde4d3856debf9379ea9
Contents?: true
Size: 557 Bytes
Versions: 8
Compression:
Stored size: 557 Bytes
Contents
# frozen_string_literal: true require 'immutable-struct' module RubyGitCrypt module Options class Name < ImmutableStruct.new(:name, :prefix) attr_reader :name def initialize(name) super(name: name.to_s) end alias to_s name def as_singular_key snake_case.to_sym end def as_plural_key :"#{snake_case}s" end private def without_prefix @name.sub(/^-+/, '') end def snake_case without_prefix.gsub('-', '_') end end end end
Version data entries
8 entries across 8 versions & 1 rubygems