Class: ProjectHealth::BasicReport

Inherits:
Object
  • Object
show all
Defined in:
lib/project-health/report/basic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oct, name) ⇒ BasicReport

Returns a new instance of BasicReport.



7
8
9
10
11
12
13
14
15
# File 'lib/project-health/report/basic.rb', line 7

def initialize(oct, name)
  @name        = name
  repo         = oct.repo(name)
  @language    = repo["language"]
  @stars       = repo["watchers_count"]
  @created     = repo["created_at"]
  @last_push   = repo["pushed_at"]
  @description = repo["description"]
end

Instance Attribute Details

#createdObject (readonly)

Returns the value of attribute created.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def created
  @created
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def description
  @description
end

#languageObject (readonly)

Returns the value of attribute language.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def language
  @language
end

#last_pushObject (readonly)

Returns the value of attribute last_push.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def last_push
  @last_push
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def name
  @name
end

#starsObject (readonly)

Returns the value of attribute stars.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def stars
  @stars
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/project-health/report/basic.rb', line 4

def title
  @title
end

Instance Method Details

#statsObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/project-health/report/basic.rb', line 17

def stats
  {
    "Basic" =>
    {
      "Name" => name,
      "Description" => description,
      "Created" => created,
      "Last push" => last_push,
      "Language" => language,
      "Stars" => stars
    }
   }
end