get_octicon

in lib/octicons_gem/lib/octicons/octicon.rb [85:99]


    def get_octicon(symbol, options = {})
      if octicon = Octicons::OCTICON_SYMBOLS[symbol]
        
        height = options[:height] || options[:width] || DEFAULT_HEIGHT
        natural_height = closest_natural_height(octicon["heights"].keys, height)
        return {
          "name" => octicon["name"],
          "keywords" => octicon["keywords"],
          "width" => octicon["heights"][natural_height.to_s]["width"].to_i,
          "height" => natural_height,
          "path" => octicon["heights"][natural_height.to_s]["path"]
        }
      end
    end