class GitHubPages::HealthCheck::Site
Attributes
Public Class Methods
Source
# File lib/github-pages-health-check/site.rb, line 8 def initialize(repository_or_domain, access_token: nil) @repository = Repository.new(repository_or_domain, :access_token => access_token) @domain = @repository.domain rescue GitHubPages::HealthCheck::Errors::InvalidRepositoryError @repository = nil @domain = Domain.redundant(repository_or_domain) end
Public Instance Methods
Source
# File lib/github-pages-health-check/site.rb, line 16 def check! [domain, repository].compact.each(&:check!) true end
Source
# File lib/github-pages-health-check/site.rb, line 21 def to_hash hash = (domain || {}).to_hash.dup hash = hash.merge(repository.to_hash) unless repository.nil? hash[:valid?] = valid? hash[:reason] = reason hash end