class Docks::Tags::Deprecated
Public Class Methods
new()
click to toggle source
# File lib/docks/tags/deprecated_tag.rb, line 4 def initialize @name = :deprecated @synonyms = [:deprecation] end
Public Instance Methods
process(symbol)
click to toggle source
# File lib/docks/tags/deprecated_tag.rb, line 9 def process(symbol) symbol.update(@name) do |deprecated| deprecated = multiline_description(deprecated) do |first_line| if match = first_line.match(/\s*(?<version>.*?)(?:\s+\-\s+(?<description>.*))?$/) description = match[:description] { version: match[:version], description: description.nil? || description.length == 0 ? nil : match[:description] } end end OpenStruct.new(deprecated) end end