Class: RocketFuel::CommandLineIcon

Inherits:
Object
  • Object
show all
Defined in:
lib/rocket_fuel/command_line_icon.rb

Instance Method Summary collapse

Constructor Details

#initialize(icon, fallback = '') ⇒ CommandLineIcon

Returns a new instance of CommandLineIcon.



3
4
5
# File 'lib/rocket_fuel/command_line_icon.rb', line 3

def initialize(icon, fallback = '')
  @icon, @fallback = icon, fallback
end

Instance Method Details

#fallback?Boolean

we must handle for ruby 1.8 without iconv

Returns:

  • (Boolean)


12
13
14
# File 'lib/rocket_fuel/command_line_icon.rb', line 12

def fallback?
  !@icon.respond_to?(:encode)
end

#renderObject



7
8
9
# File 'lib/rocket_fuel/command_line_icon.rb', line 7

def render
  fallback? ? @fallback : @icon
end