Class: GitReporting::Source::Array
- Inherits:
-
Object
- Object
- GitReporting::Source::Array
- Defined in:
- lib/git_reporting/source/array.rb
Instance Attribute Summary collapse
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
Instance Method Summary collapse
- #fetch(period) ⇒ Object
- #fetch_all ⇒ Object
-
#initialize(commits_array) ⇒ Array
constructor
A new instance of Array.
Constructor Details
#initialize(commits_array) ⇒ Array
Returns a new instance of Array.
7 8 9 10 |
# File 'lib/git_reporting/source/array.rb', line 7 def initialize(commits_array) @commits = extract_commits_from_array(commits_array) sort_commits! end |
Instance Attribute Details
#commits ⇒ Object (readonly)
Returns the value of attribute commits.
5 6 7 |
# File 'lib/git_reporting/source/array.rb', line 5 def commits @commits end |
Instance Method Details
#fetch(period) ⇒ Object
12 13 14 |
# File 'lib/git_reporting/source/array.rb', line 12 def fetch(period) commits.select { |commit| period === commit. } end |
#fetch_all ⇒ Object
16 17 18 |
# File 'lib/git_reporting/source/array.rb', line 16 def fetch_all commits end |