Class: Hubba::Folio::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/hubba/reports/folio.rb

Overview

(nested) class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, name) ⇒ Repo

Returns a new instance of Repo.



9
10
11
12
# File 'lib/hubba/reports/folio.rb', line 9

def initialize( owner, name )
  @owner = owner   ## rename to login, username - why? why not?
  @name  = name    ## rename to reponame ??
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/hubba/reports/folio.rb', line 6

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



6
7
8
# File 'lib/hubba/reports/folio.rb', line 6

def owner
  @owner
end

Instance Method Details

#diffObject



25
26
27
# File 'lib/hubba/reports/folio.rb', line 25

def diff
  @diff ||= stats.calc_diff_stars( samples: 3, days: 30 )
end

#full_nameObject



14
# File 'lib/hubba/reports/folio.rb', line 14

def full_name() "#{owner}/#{name}"; end

#statsObject



16
17
18
19
20
21
22
23
# File 'lib/hubba/reports/folio.rb', line 16

def stats
  ## note: load stats on demand only (first access) for now - why? why not?
  @stats ||= begin
               stats = Stats.new( full_name )
               stats.read
               stats
             end
end