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.



87
88
89
90
91
92
# File 'lib/fontist/errors.rb', line 87

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.



85
86
87
# File 'lib/fontist/errors.rb', line 85

def font
  @font
end

#styleObject (readonly)

Returns the value of attribute style.



85
86
87
# File 'lib/fontist/errors.rb', line 85

def style
  @style
end

Instance Method Details

#nameObject



94
95
96
97
98
99
# File 'lib/fontist/errors.rb', line 94

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