Sha256: b16c48f721075c353e7b2df3e35d845cc0d72bfd7e837c2e7c16671e2e80c357
Contents?: true
Size: 408 Bytes
Versions: 17
Compression:
Stored size: 408 Bytes
Contents
class TicketTag def initialize(name, color) @name = name @color = color end attr_reader :name, :color def self.from_s(string) name, color = string.scan(/\[([^\]]+)\]\(([a-fA-F0-9]{6})\)/).flatten name = string unless name color = "e4e4e4" unless color new(name, color) end def to_s "[#{name}](#{color})" end def to_h {name: name, color: color} end end
Version data entries
17 entries across 17 versions & 1 rubygems