Class: GithubStats::Datapoint

Inherits:
Struct
  • Object
show all
Defined in:
lib/githubstats/data.rb

Overview

Helper struct for defining datapoints

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date

Returns:

  • (Object)

    the current value of date


15
16
17
# File 'lib/githubstats/data.rb', line 15

def date
  @date
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score


15
16
17
# File 'lib/githubstats/data.rb', line 15

def score
  @score
end

Instance Method Details

#to_aObject


16
17
18
# File 'lib/githubstats/data.rb', line 16

def to_a
  [date.strftime('%Y-%m-%d'), score.to_s]
end