class Trendhub::Repository

Constants

TIME_ALIASES

Attributes

added_stars[R]
desc[R]
forks[R]
language[R]
name[R]
stars[R]
time_range[R]
url[R]

Public Class Methods

new(data) click to toggle source
# File lib/trendhub/repository.rb, line 20
def initialize(data)
  @name = data.fetch(:name)
  @time_range = data.fetch(:time_range)
  @url = data.fetch(:url)
  @desc = data.fetch(:desc)
  @language = data.fetch(:language)
  @added_stars = data.fetch(:added_stars)
  @stars = data.fetch(:stars)
  @forks = data.fetch(:forks)
end

Public Instance Methods

time_period() click to toggle source
# File lib/trendhub/repository.rb, line 31
def time_period
  return 'today' unless self.time_range
  TIME_ALIASES[self.time_range]
end