class Theysaidso::QOD

Attributes

author[R]
category[R]
id[R]
length[R]
quote[R]
success[R]
tags[R]

Public Class Methods

fetch() click to toggle source
# File lib/theysaidso/qod.rb, line 19
def self.fetch
  response = Faraday.get(API_URL)
  attrs = JSON.parse(response.body)
  new(attrs)
end
new(attrs) click to toggle source
# File lib/theysaidso/qod.rb, line 9
def initialize(attrs)
  @id       = attrs['contents']['id']
  @quote    = attrs['contents']['quote']
  @author   = attrs['contents']['author']
  @length   = attrs['contents']['length']
  @tags     = attrs['contents']['tags']
  @categroy = attrs['contents']['categroy']
  @success  = attrs['success']['total']
end