Exception: Fontist::Errors::FontError

Inherits:
GeneralError
  • Object
show all
Defined in:
lib/fontist/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, font = nil, style = nil) ⇒ FontError

Returns a new instance of FontError.



70
71
72
73
74
75
# File 'lib/fontist/errors.rb', line 70

def initialize(msg, font = nil, style = nil)
  @font = font
  @style = style

  super(msg)
end

Instance Attribute Details

#fontObject (readonly)

Returns the value of attribute font.



68
69
70
# File 'lib/fontist/errors.rb', line 68

def font
  @font
end

#styleObject (readonly)

Returns the value of attribute style.



68
69
70
# File 'lib/fontist/errors.rb', line 68

def style
  @style
end

Instance Method Details

#nameObject



77
78
79
80
81
82
# File 'lib/fontist/errors.rb', line 77

def name
  messages = []
  messages << "Font name: '#{@font}'"
  messages << "Style: '#{@style}'" if @style
  messages.join("; ")
end