Sha256: 2c8ed8d31f74de7ba7599487b7d16defe2dcacbac3ea6ba976258604863d7880

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 Bytes

Contents

module Signore class Signature < Struct.new :text, :author, :source, :subject, :tags

  def display
    Wrapper.new(text, meta).display
  end

  def tagged_with? tag
    tags and tags.include? tag
  end

  private

  def meta
    case
    when author && subject && source then "#{author} #{subject}, #{source}"
    when author && subject           then "#{author} #{subject}"
    when author && source            then "#{author}, #{source}"
    when author                      then "#{author}"
    when source                      then "#{source}"
    when subject                     then "#{subject}"
    end
  end

end end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signore-0.0.0 lib/signore/signature.rb