Sha256: 6b69cffc646cc9abe803ef1d1bd4aa7042bb5487914204a19b7de655bb3f00da

Contents?: true

Size: 518 Bytes

Versions: 17

Compression:

Stored size: 518 Bytes

Contents

class Ppl::Format::Contact::Name < Ppl::Format::Contact

  attr_writer :color_adapter
  attr_writer :colors

  def initialize(colors={})
    @colors = colors
    @color_adapter = Ppl::Adapter::Color::Colored.new
  end

  def process(contact)
    output = ""
    if !contact.name.nil?
      output += contact.name
    end
    colorize_output(output)
  end

  private

  def colorize_output(string)
    if @colors["name"]
      @color_adapter.colorize(string, @colors["name"])
    else
      string
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ppl-2.0.0 lib/ppl/format/contact/name.rb
ppl-1.25.0 lib/ppl/format/contact/name.rb
ppl-1.24.0 lib/ppl/format/contact/name.rb
ppl-1.23.0 lib/ppl/format/contact/name.rb
ppl-1.22.2 lib/ppl/format/contact/name.rb
ppl-1.22.1 lib/ppl/format/contact/name.rb
ppl-1.22.0 lib/ppl/format/contact/name.rb
ppl-1.21.0 lib/ppl/format/contact/name.rb
ppl-1.20.0 lib/ppl/format/contact/name.rb
ppl-1.19.0 lib/ppl/format/contact/name.rb
ppl-1.18.0 lib/ppl/format/contact/name.rb
ppl-1.17.2 lib/ppl/format/contact/name.rb
ppl-1.17.1 lib/ppl/format/contact/name.rb
ppl-1.17.0 lib/ppl/format/contact/name.rb
ppl-1.16.0 lib/ppl/format/contact/name.rb
ppl-1.15.1 lib/ppl/format/contact/name.rb
ppl-1.15.0 lib/ppl/format/contact/name.rb