Class: Hubba::Summary::Repo

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

Overview

(nested) class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, name) ⇒ Repo

Returns a new instance of Repo.



37
38
39
40
# File 'lib/hubba/reposet.rb', line 37

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.



34
35
36
# File 'lib/hubba/reposet.rb', line 34

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



34
35
36
# File 'lib/hubba/reposet.rb', line 34

def owner
  @owner
end

Instance Method Details

#diffObject



53
54
55
# File 'lib/hubba/reposet.rb', line 53

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

#full_nameObject



42
# File 'lib/hubba/reposet.rb', line 42

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

#statsObject



44
45
46
47
48
49
50
51
# File 'lib/hubba/reposet.rb', line 44

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