Method: GithubChart::Chart#initialize
- Defined in:
- lib/githubchart.rb
#initialize(params = {}) ⇒ Chart
Create a new chart object Passes the username through to GithubStats Uses colors rather than default, if provided
59 60 61 62 63 64 |
# File 'lib/githubchart.rb', line 59 def initialize(params = {}) params = { user: params } unless params.is_a? Hash @stats = load_stats(params[:data], params[:user]) @colors = params[:colors] || :default @colors = COLOR_SCHEMES[@colors] unless @colors.is_a? Array end |