Sha256: 19b21243f390a52653e467a696ec7b578e3e0e567af4f802e7d68cd1dfd81a31
Contents?: true
Size: 769 Bytes
Versions: 17
Compression:
Stored size: 769 Bytes
Contents
# frozen_string_literal: true require "refinements/strings" module Pennyworth module Presenters # Renders a GitHub repository record into a compatible format for use in Alfred script filters. class Repository using Refinements::Strings def initialize record, inflector: Inflector.new @record = record @inflector = inflector end def id = record.fetch(:name) def label = inflector.call(id.titleize) def subtitle = record.fetch(:description) def site_url = record.fetch(:homepage) def source_url = record.fetch(:html_url) def issues_url = "#{source_url}/issues" def versions_url = "#{site_url}/versions" private attr_reader :record, :inflector end end end
Version data entries
17 entries across 17 versions & 1 rubygems