Class: Ppl::Format::Name::FullOnly

Inherits:
Ppl::Format::Name show all
Defined in:
lib/ppl/format/name/full_only.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(colors = {}) ⇒ FullOnly

Returns a new instance of FullOnly.



6
7
8
9
# File 'lib/ppl/format/name/full_only.rb', line 6

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

Instance Attribute Details

#color_adapter=(value) ⇒ Object (writeonly)

Sets the attribute color_adapter

Parameters:

  • value

    the value to set the attribute color_adapter to.



3
4
5
# File 'lib/ppl/format/name/full_only.rb', line 3

def color_adapter=(value)
  @color_adapter = value
end

#colors=(value) ⇒ Object (writeonly)

Sets the attribute colors

Parameters:

  • value

    the value to set the attribute colors to.



4
5
6
# File 'lib/ppl/format/name/full_only.rb', line 4

def colors=(value)
  @colors = value
end

Instance Method Details

#process(name) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/ppl/format/name/full_only.rb', line 11

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