Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor method name

  • Loading branch information...
commit 0145ff4ced6a266469230ee23946764078bb5400 1 parent fc76c22
@ruedap authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 workflow/lib/font_awesome.rb
View
26 workflow/lib/font_awesome.rb
@@ -15,20 +15,20 @@ class Icon
def initialize(id)
@id = id
- unicode = detect_unicode_from_id(id)
- @unicode = unicode ? unicode : detect_unicode_from_aliases(id)
+ unicode = find_unicode_from_id(id)
+ @unicode = unicode ? unicode : find_unicode_from_aliases(id)
end
- def detect_unicode_from_id(id)
- detected_icon = ICONS.detect { |icon| icon['id'] == id }
- detected_icon ? detected_icon['unicode'] : nil
+ def find_unicode_from_id(id)
+ found_icon = ICONS.find { |icon| icon['id'] == id }
+ found_icon ? found_icon['unicode'] : nil
end
- def detect_unicode_from_aliases(id)
- detected_icon = ICONS.detect do |icon|
+ def find_unicode_from_aliases(id)
+ found_icon = ICONS.find do |icon|
icon['aliases'].include?(id) if icon['aliases']
end
- detected_icon ? detected_icon['unicode'] : nil
+ found_icon ? found_icon['unicode'] : nil
end
end
@@ -52,12 +52,12 @@ def select!(queries, icons = @icons)
def item_hash(icon)
{
- :uid => '',
- :title => icon.id,
+ :uid => '',
+ :title => icon.id,
:subtitle => "Paste class name: fa-#{icon.id}",
- :arg => "#{icon.id}|||#{icon.unicode}",
- :icon => { :type => 'default', :name => "./icons/fa-#{icon.id}.png" },
- :valid => 'yes',
+ :arg => "#{icon.id}|||#{icon.unicode}",
+ :icon => { :type => 'default', :name => "./icons/fa-#{icon.id}.png" },
+ :valid => 'yes',
}
end
Please sign in to comment.
Something went wrong with that request. Please try again.