Class: Hubload::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/hubload/repo.rb

Defined Under Namespace

Classes: Owner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo) ⇒ Repo

Returns a new instance of Repo.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/hubload/repo.rb', line 7

def initialize(repo)
  @forks = repo['forks']
  @description = repo['description']
  @watchers = repo['watchers']
  @open_issues = repo['open_issues']
  @url = repo['url']
  @fork = repo['fork']
  @publicly_visible = !repo['private']
  @homepage = repo['homepage']
  @owner = Owner.new(repo['owner']['name'], repo['owner']['email'])
  @name = repo['name']
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def description
  @description
end

#forkObject

Returns the value of attribute fork.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def fork
  @fork
end

#forksObject

Returns the value of attribute forks.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def forks
  @forks
end

#homepageObject

Returns the value of attribute homepage.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def homepage
  @homepage
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def name
  @name
end

#open_issuesObject

Returns the value of attribute open_issues.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def open_issues
  @open_issues
end

#ownerObject

Returns the value of attribute owner.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def owner
  @owner
end

#publicly_visibleObject

Returns the value of attribute publicly_visible.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def publicly_visible
  @publicly_visible
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def url
  @url
end

#watchersObject

Returns the value of attribute watchers.



4
5
6
# File 'lib/hubload/repo.rb', line 4

def watchers
  @watchers
end

Instance Method Details

#fork?Boolean

Returns true if the repo is a fork, false otherwise

Returns:

  • (Boolean)


26
27
28
# File 'lib/hubload/repo.rb', line 26

def fork?
  @fork
end

#publicly_visible?Boolean

Returns true if the repo is public, false otherwise

Returns:

  • (Boolean)


21
22
23
# File 'lib/hubload/repo.rb', line 21

def publicly_visible?
  @publicly_visible
end