Class: GWebFont::WebFont

Inherits:
Object
  • Object
show all
Defined in:
lib/g_web_font/web_font.rb

Class Method Summary collapse

Class Method Details

.list_fontsObject



6
7
8
# File 'lib/g_web_font/web_font.rb', line 6

def list_fonts
   load_font_items.map{ |font| font['family'] }
end

.load_font_itemsObject



10
11
12
13
14
15
# File 'lib/g_web_font/web_font.rb', line 10

def load_font_items
  response = HTTParty.get(BASE_URL, :query => { :key => GWebFont.api_key })
  font_items = Oj.load(response.body)['items']

  font_items
end