Class: Avm::Scms::Inflector

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/scms/inflector.rb

Constant Summary collapse

ISSUE_POINTER_NAME_PREFIX =
'issue_'
POINTER_NAME_TO_ISSUE_PATTERN =
/\A#{Regexp.quote(ISSUE_POINTER_NAME_PREFIX)}(\d+)\z/.freeze
POINTER_NAME_TO_ISSUE_PARSER =
POINTER_NAME_TO_ISSUE_PATTERN.to_parser { |m| m[1] }

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_instanceObject



7
8
9
# File 'lib/avm/scms/inflector.rb', line 7

def default_instance
  @default_instance ||= new
end

Instance Method Details

#pointer_name_to_issue_id(pointer_name) ⇒ String?

Returns:

  • (String, nil)


17
18
19
# File 'lib/avm/scms/inflector.rb', line 17

def pointer_name_to_issue_id(pointer_name)
  POINTER_NAME_TO_ISSUE_PARSER.parse(pointer_name)
end