Class: ContributorsStats::Reader
- Includes:
- JsonHelper
- Defined in:
- lib/contributors_stats/reader.rb,
lib/plugins/contributors_stats/reader/gh_org.rb,
lib/plugins/contributors_stats/reader/gh_repo.rb
Overview
Base for reading ContributorsStats data
Direct Known Subclasses
Defined Under Namespace
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#raw_data ⇒ Object
readonly
Returns the value of attribute raw_data.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Reader
constructor
A new instance of Reader.
-
#load(type, name) ⇒ Object
load data using given plugin.
Methods included from JsonHelper
#load_json, #path_prefix, #path_suffix, #url_builder
Constructor Details
#initialize(options = {}) ⇒ Reader
Returns a new instance of Reader.
12 13 14 15 16 17 18 |
# File 'lib/contributors_stats/reader.rb', line 12 def initialize( = {}) configure_path(*.delete(:configure_path)) if [:configure_path] super() @raw_data = [] @data = nil parse_readers(("reader")) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/contributors_stats/reader.rb', line 10 def data @data end |
#raw_data ⇒ Object (readonly)
Returns the value of attribute raw_data.
10 11 12 |
# File 'lib/contributors_stats/reader.rb', line 10 def raw_data @raw_data end |
Instance Method Details
#load(type, name) ⇒ Object
load data using given plugin
23 24 25 26 27 28 29 |
# File 'lib/contributors_stats/reader.rb', line 23 def load(type, name) reader_plugin(type).load(name) do |data, name| log "repository: #{name}" @raw_data += data end @data = nil end |