Sha256: 2d6ceae2e5e78e48dd3d857095e41918193735077e31cf0b1b8a712cadce0909

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

module Strava
  class Stream
    # Class to represent Strava Stream
    # https://strava.github.io/api/v3/activities/

    attr_reader :type, :data

    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

    def size
      @data.size
    end
    def [](i)
      @data[i]
    end

  end
end

__END__

ca = Strava::Athlete.current_athlete;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strava-0.1.0 lib/strava/stream.rb