decko-commons/decko

View on GitHub
card/config/initializers/01_core_extensions/array.rb

Summary

Maintainability
A
0 mins
Test Coverage
module CoreExtensions
  module Array
    def to_pointer_content
      map do |item|
        item = item.to_s.strip
        item.gsub!(/^\[\[/, "")
        item.gsub!(/\]\]$/, "")
        item
        # item =~ /^\[\[.+\]\]$/ ? item : "[[#{item}]]"
      end.join "\n"
    end

    def cardname
      Card::Name.compose self
    end
    alias_method :to_name, :cardname
  end
end