module Conjunction::NamingConvention
A NamingConvention defines the name formatting of a given Junction.
Public Instance Methods
conjunction_prefix?()
click to toggle source
# File lib/conjunction/naming_convention.rb, line 15 def conjunction_prefix? conjunction_prefix.present? end
conjunction_suffix?()
click to toggle source
# File lib/conjunction/naming_convention.rb, line 19 def conjunction_suffix? conjunction_suffix.present? end
conjunctive?()
click to toggle source
# File lib/conjunction/naming_convention.rb, line 11 def conjunctive? conjunction_prefix? || conjunction_suffix? end
inherited(base)
click to toggle source
Calls superclass method
# File lib/conjunction/naming_convention.rb, line 23 def inherited(base) base.prefixed_with(conjunction_prefix) if conjunction_prefix? base.suffixed_with(conjunction_suffix) if conjunction_suffix? super end
prefixed_with(prefix)
click to toggle source
# File lib/conjunction/naming_convention.rb, line 31 def prefixed_with(prefix) raise TypeError, "prefix must be a string" if prefix.present? && !prefix.is_a?(String) @conjunction_prefix = prefix end
suffixed_with(suffix)
click to toggle source
# File lib/conjunction/naming_convention.rb, line 37 def suffixed_with(suffix) raise TypeError, "suffix must be a string" if suffix.present? && !suffix.is_a?(String) @conjunction_suffix = suffix end