lib/jazzy/source_mark.rb in jazzy-0.12.0 vs lib/jazzy/source_mark.rb in jazzy-0.13.0
- old
+ new
@@ -26,16 +26,27 @@
end_index = has_end_dash ? -3 : -1
self.name = mark_string[start_index..end_index]
end
+ def self.new_generic_requirements(requirements)
+ marked_up = requirements.gsub(/\b([^=:]\S*)\b/, '`\1`')
+ text = "Available where #{marked_up}"
+ new(text)
+ end
+
def empty?
!name && !has_start_dash && !has_end_dash
end
def copy(other)
self.name = other.name
self.has_start_dash = other.has_start_dash
self.has_end_dash = other.has_end_dash
+ end
+
+ # Can we merge the contents of another mark into our own?
+ def can_merge?(other)
+ other.empty? || other.name == name
end
end
end