lib/prawn/icon/font_data.rb in prawn-icon-1.0.0 vs lib/prawn/icon/font_data.rb in prawn-icon-1.1.0
- old
+ new
@@ -77,17 +77,15 @@
def specifier
@specifier ||= yaml.keys[0]
end
def unicode(key)
- char = yaml[specifier][key]
-
- unless char
- raise Prawn::Errors::IconNotFound,
- "Key: #{specifier}-#{key} not found"
+ yaml[specifier][key].tap do |char|
+ unless char
+ raise Prawn::Errors::IconNotFound,
+ "Key: #{specifier}-#{key} not found"
+ end
end
-
- char
end
def keys
# Strip the first element: __font_version__
yaml[specifier].keys.map { |k| "#{specifier}-#{k}" }.drop(1)