Class: Strava::Route::Images
- Inherits:
-
Object
- Object
- Strava::Route::Images
- Defined in:
- lib/strava/route/images.rb,
lib/strava/route/images/version.rb
Constant Summary collapse
- VERSION =
"0.1.1"
Instance Attribute Summary collapse
-
#altimetry ⇒ Object
readonly
Returns the value of attribute altimetry.
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(url, options = {}) ⇒ Images
constructor
A new instance of Images.
Constructor Details
#initialize(url, options = {}) ⇒ Images
Returns a new instance of Images.
13 14 15 16 17 18 19 20 |
# File 'lib/strava/route/images.rb', line 13 def initialize(url, = {}) raise ::Strava::Route::InvalidUrl unless url.match?(/strava.com/) @url = url @base = [:base] ||= "#{Tempfile.new('strava-base').path}.png" @route = [:route] ||= "#{Tempfile.new('strava-route').path}.png" @altimetry = [:altimetry] ||= "#{Tempfile.new('strava-altimetry').path}.png" end |
Instance Attribute Details
#altimetry ⇒ Object (readonly)
Returns the value of attribute altimetry.
11 12 13 |
# File 'lib/strava/route/images.rb', line 11 def altimetry @altimetry end |
#base ⇒ Object (readonly)
Returns the value of attribute base.
11 12 13 |
# File 'lib/strava/route/images.rb', line 11 def base @base end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
11 12 13 |
# File 'lib/strava/route/images.rb', line 11 def route @route end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
11 12 13 |
# File 'lib/strava/route/images.rb', line 11 def url @url end |
Instance Method Details
#extract ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/strava/route/images.rb', line 22 def extract { base: extract_screenshot, route: extract_route, altimetry: extract_altimetry } end |