Class: Strava::Stream
- Inherits:
-
Object
- Object
- Strava::Stream
- Defined in:
- lib/strava/stream.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Class to represent Strava Stream https://strava.github.io/api/v3/activities/.
-
#type ⇒ Object
readonly
Class to represent Strava Stream https://strava.github.io/api/v3/activities/.
Instance Method Summary collapse
- #[](i) ⇒ Object
-
#initialize(data) ⇒ Stream
constructor
A new instance of Stream.
- #size ⇒ Object
Constructor Details
#initialize(data) ⇒ Stream
Returns a new instance of Stream.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/strava/stream.rb', line 8 def initialize(data) # @response = data @id = data["id"] @type = data["type"] # => "latlng", @data = data["data"] # => [...], @series_type = data["series_type"] # => "distance", @original_size = data["original_size"] # => 512, @resolution = data["resolution"] # => "low" self end |
Instance Attribute Details
#data ⇒ Object (readonly)
Class to represent Strava Stream https://strava.github.io/api/v3/activities/
6 7 8 |
# File 'lib/strava/stream.rb', line 6 def data @data end |
#type ⇒ Object (readonly)
Class to represent Strava Stream https://strava.github.io/api/v3/activities/
6 7 8 |
# File 'lib/strava/stream.rb', line 6 def type @type end |
Instance Method Details
#[](i) ⇒ Object
24 25 26 |
# File 'lib/strava/stream.rb', line 24 def [](i) @data[i] end |
#size ⇒ Object
21 22 23 |
# File 'lib/strava/stream.rb', line 21 def size @data.size end |