Class: Ghub::Models::Repository

Inherits:
Struct
  • Object
show all
Defined in:
lib/ghub/models/repository.rb

Overview

Defines a repository.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRepository

Returns a new instance of Repository.



103
104
105
106
# File 'lib/ghub/models/repository.rb', line 103

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#allow_forkingObject

Returns the value of attribute allow_forking

Returns:

  • (Object)

    the current value of allow_forking



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def allow_forking
  @allow_forking
end

#archive_urlObject

Returns the value of attribute archive_url

Returns:

  • (Object)

    the current value of archive_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def archive_url
  @archive_url
end

#archivedObject

Returns the value of attribute archived

Returns:

  • (Object)

    the current value of archived



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def archived
  @archived
end

#assignees_urlObject

Returns the value of attribute assignees_url

Returns:

  • (Object)

    the current value of assignees_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def assignees_url
  @assignees_url
end

#blobs_urlObject

Returns the value of attribute blobs_url

Returns:

  • (Object)

    the current value of blobs_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def blobs_url
  @blobs_url
end

#branches_urlObject

Returns the value of attribute branches_url

Returns:

  • (Object)

    the current value of branches_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def branches_url
  @branches_url
end

#clone_urlObject

Returns the value of attribute clone_url

Returns:

  • (Object)

    the current value of clone_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def clone_url
  @clone_url
end

#collaborators_urlObject

Returns the value of attribute collaborators_url

Returns:

  • (Object)

    the current value of collaborators_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def collaborators_url
  @collaborators_url
end

#comments_urlObject

Returns the value of attribute comments_url

Returns:

  • (Object)

    the current value of comments_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def comments_url
  @comments_url
end

#commits_urlObject

Returns the value of attribute commits_url

Returns:

  • (Object)

    the current value of commits_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def commits_url
  @commits_url
end

#compare_urlObject

Returns the value of attribute compare_url

Returns:

  • (Object)

    the current value of compare_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def compare_url
  @compare_url
end

#contents_urlObject

Returns the value of attribute contents_url

Returns:

  • (Object)

    the current value of contents_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def contents_url
  @contents_url
end

#contributors_urlObject

Returns the value of attribute contributors_url

Returns:

  • (Object)

    the current value of contributors_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def contributors_url
  @contributors_url
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def created_at
  @created_at
end

#default_branchObject

Returns the value of attribute default_branch

Returns:

  • (Object)

    the current value of default_branch



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def default_branch
  @default_branch
end

#deployments_urlObject

Returns the value of attribute deployments_url

Returns:

  • (Object)

    the current value of deployments_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def deployments_url
  @deployments_url
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def description
  @description
end

#disabledObject

Returns the value of attribute disabled

Returns:

  • (Object)

    the current value of disabled



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def disabled
  @disabled
end

#downloads_urlObject

Returns the value of attribute downloads_url

Returns:

  • (Object)

    the current value of downloads_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def downloads_url
  @downloads_url
end

#events_urlObject

Returns the value of attribute events_url

Returns:

  • (Object)

    the current value of events_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def events_url
  @events_url
end

#forkObject

Returns the value of attribute fork

Returns:

  • (Object)

    the current value of fork



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def fork
  @fork
end

#forksObject

Returns the value of attribute forks

Returns:

  • (Object)

    the current value of forks



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def forks
  @forks
end

#forks_countObject

Returns the value of attribute forks_count

Returns:

  • (Object)

    the current value of forks_count



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def forks_count
  @forks_count
end

#forks_urlObject

Returns the value of attribute forks_url

Returns:

  • (Object)

    the current value of forks_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def forks_url
  @forks_url
end

#full_nameObject

Returns the value of attribute full_name

Returns:

  • (Object)

    the current value of full_name



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def full_name
  @full_name
end

#git_commits_urlObject

Returns the value of attribute git_commits_url

Returns:

  • (Object)

    the current value of git_commits_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def git_commits_url
  @git_commits_url
end

#git_refs_urlObject

Returns the value of attribute git_refs_url

Returns:

  • (Object)

    the current value of git_refs_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def git_refs_url
  @git_refs_url
end

#git_tags_urlObject

Returns the value of attribute git_tags_url

Returns:

  • (Object)

    the current value of git_tags_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def git_tags_url
  @git_tags_url
end

#git_urlObject

Returns the value of attribute git_url

Returns:

  • (Object)

    the current value of git_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def git_url
  @git_url
end

#has_downloadsObject

Returns the value of attribute has_downloads

Returns:

  • (Object)

    the current value of has_downloads



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def has_downloads
  @has_downloads
end

#has_issuesObject

Returns the value of attribute has_issues

Returns:

  • (Object)

    the current value of has_issues



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def has_issues
  @has_issues
end

#has_pagesObject

Returns the value of attribute has_pages

Returns:

  • (Object)

    the current value of has_pages



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def has_pages
  @has_pages
end

#has_projectsObject

Returns the value of attribute has_projects

Returns:

  • (Object)

    the current value of has_projects



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def has_projects
  @has_projects
end

#has_wikiObject

Returns the value of attribute has_wiki

Returns:

  • (Object)

    the current value of has_wiki



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def has_wiki
  @has_wiki
end

#homepageObject

Returns the value of attribute homepage

Returns:

  • (Object)

    the current value of homepage



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def homepage
  @homepage
end

#hooks_urlObject

Returns the value of attribute hooks_url

Returns:

  • (Object)

    the current value of hooks_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def hooks_url
  @hooks_url
end

#html_urlObject

Returns the value of attribute html_url

Returns:

  • (Object)

    the current value of html_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def html_url
  @html_url
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def id
  @id
end

#is_templateObject

Returns the value of attribute is_template

Returns:

  • (Object)

    the current value of is_template



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def is_template
  @is_template
end

#issue_comment_urlObject

Returns the value of attribute issue_comment_url

Returns:

  • (Object)

    the current value of issue_comment_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def issue_comment_url
  @issue_comment_url
end

#issue_events_urlObject

Returns the value of attribute issue_events_url

Returns:

  • (Object)

    the current value of issue_events_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def issue_events_url
  @issue_events_url
end

#issues_urlObject

Returns the value of attribute issues_url

Returns:

  • (Object)

    the current value of issues_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def issues_url
  @issues_url
end

#keys_urlObject

Returns the value of attribute keys_url

Returns:

  • (Object)

    the current value of keys_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def keys_url
  @keys_url
end

#labels_urlObject

Returns the value of attribute labels_url

Returns:

  • (Object)

    the current value of labels_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def labels_url
  @labels_url
end

#languageObject

Returns the value of attribute language

Returns:

  • (Object)

    the current value of language



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def language
  @language
end

#languages_urlObject

Returns the value of attribute languages_url

Returns:

  • (Object)

    the current value of languages_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def languages_url
  @languages_url
end

#licenseObject

Returns the value of attribute license

Returns:

  • (Object)

    the current value of license



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def license
  @license
end

#merges_urlObject

Returns the value of attribute merges_url

Returns:

  • (Object)

    the current value of merges_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def merges_url
  @merges_url
end

#milestones_urlObject

Returns the value of attribute milestones_url

Returns:

  • (Object)

    the current value of milestones_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def milestones_url
  @milestones_url
end

#mirror_urlObject

Returns the value of attribute mirror_url

Returns:

  • (Object)

    the current value of mirror_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def mirror_url
  @mirror_url
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def name
  @name
end

#network_countObject

Returns the value of attribute network_count

Returns:

  • (Object)

    the current value of network_count



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def network_count
  @network_count
end

#node_idObject

Returns the value of attribute node_id

Returns:

  • (Object)

    the current value of node_id



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def node_id
  @node_id
end

#notifications_urlObject

Returns the value of attribute notifications_url

Returns:

  • (Object)

    the current value of notifications_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def notifications_url
  @notifications_url
end

#open_issuesObject

Returns the value of attribute open_issues

Returns:

  • (Object)

    the current value of open_issues



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def open_issues
  @open_issues
end

#open_issues_countObject

Returns the value of attribute open_issues_count

Returns:

  • (Object)

    the current value of open_issues_count



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def open_issues_count
  @open_issues_count
end

#organizationObject

Returns the value of attribute organization

Returns:

  • (Object)

    the current value of organization



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def organization
  @organization
end

#ownerObject

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def owner
  @owner
end

#permissionsObject

Returns the value of attribute permissions

Returns:

  • (Object)

    the current value of permissions



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def permissions
  @permissions
end

#privateObject

Returns the value of attribute private

Returns:

  • (Object)

    the current value of private



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def private
  @private
end

#pulls_urlObject

Returns the value of attribute pulls_url

Returns:

  • (Object)

    the current value of pulls_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def pulls_url
  @pulls_url
end

#pushed_atObject

Returns the value of attribute pushed_at

Returns:

  • (Object)

    the current value of pushed_at



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def pushed_at
  @pushed_at
end

#releases_urlObject

Returns the value of attribute releases_url

Returns:

  • (Object)

    the current value of releases_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def releases_url
  @releases_url
end

#ssh_urlObject

Returns the value of attribute ssh_url

Returns:

  • (Object)

    the current value of ssh_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def ssh_url
  @ssh_url
end

#stargazers_countObject

Returns the value of attribute stargazers_count

Returns:

  • (Object)

    the current value of stargazers_count



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def stargazers_count
  @stargazers_count
end

#stargazers_urlObject

Returns the value of attribute stargazers_url

Returns:

  • (Object)

    the current value of stargazers_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def stargazers_url
  @stargazers_url
end

#statuses_urlObject

Returns the value of attribute statuses_url

Returns:

  • (Object)

    the current value of statuses_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def statuses_url
  @statuses_url
end

#subscribers_countObject

Returns the value of attribute subscribers_count

Returns:

  • (Object)

    the current value of subscribers_count



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def subscribers_count
  @subscribers_count
end

#subscribers_urlObject

Returns the value of attribute subscribers_url

Returns:

  • (Object)

    the current value of subscribers_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def subscribers_url
  @subscribers_url
end

#subscription_urlObject

Returns the value of attribute subscription_url

Returns:

  • (Object)

    the current value of subscription_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def subscription_url
  @subscription_url
end

#svn_urlObject

Returns the value of attribute svn_url

Returns:

  • (Object)

    the current value of svn_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def svn_url
  @svn_url
end

#tags_urlObject

Returns the value of attribute tags_url

Returns:

  • (Object)

    the current value of tags_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def tags_url
  @tags_url
end

#teams_urlObject

Returns the value of attribute teams_url

Returns:

  • (Object)

    the current value of teams_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def teams_url
  @teams_url
end

#temp_clone_tokenObject

Returns the value of attribute temp_clone_token

Returns:

  • (Object)

    the current value of temp_clone_token



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def temp_clone_token
  @temp_clone_token
end

#topicsObject

Returns the value of attribute topics

Returns:

  • (Object)

    the current value of topics



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def topics
  @topics
end

#trees_urlObject

Returns the value of attribute trees_url

Returns:

  • (Object)

    the current value of trees_url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def trees_url
  @trees_url
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def updated_at
  @updated_at
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def url
  @url
end

#visibilityObject

Returns the value of attribute visibility

Returns:

  • (Object)

    the current value of visibility



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def visibility
  @visibility
end

#watchersObject

Returns the value of attribute watchers

Returns:

  • (Object)

    the current value of watchers



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def watchers
  @watchers
end

#watchers_countObject

Returns the value of attribute watchers_count

Returns:

  • (Object)

    the current value of watchers_count



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def watchers_count
  @watchers_count
end

#web_commit_signoff_requiredObject

Returns the value of attribute web_commit_signoff_required

Returns:

  • (Object)

    the current value of web_commit_signoff_required



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def web_commit_signoff_required
  @web_commit_signoff_required
end

#weightObject

Returns the value of attribute weight

Returns:

  • (Object)

    the current value of weight



6
7
8
# File 'lib/ghub/models/repository.rb', line 6

def weight
  @weight
end

Class Method Details

.for(**attributes) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/ghub/models/repository.rb', line 91

def self.for(**attributes)
  new(
    **attributes.transform_keys!(size: :weight),
    license: (License[**Hash(attributes[:license])] if attributes.key? :license),
    owner: User[**attributes[:owner]],
    organization: (User[**attributes[:organization]] if attributes.key? :organization),
    permissions: (
      Permissions::Repository[**attributes[:permissions]] if attributes.key? :permissions
    )
  )
end