mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
22 lines
434 B
Ruby
22 lines
434 B
Ruby
require "dry-struct"
|
|
require_relative "../site"
|
|
|
|
module Pressa
|
|
module Projects
|
|
class Project < Dry::Struct
|
|
attribute :name, Types::String
|
|
attribute :title, Types::String
|
|
attribute :description, Types::String
|
|
attribute :url, Types::String
|
|
|
|
def github_path
|
|
uri = URI.parse(url)
|
|
uri.path.sub(/^\//, "")
|
|
end
|
|
|
|
def path
|
|
"/projects/#{name}"
|
|
end
|
|
end
|
|
end
|
|
end
|