Class: PictureTag::Instructions::CdnUrl
- Inherits:
-
Instruction
- Object
- Instruction
- PictureTag::Instructions::CdnUrl
- Defined in:
- lib/jekyll_picture_tag/instructions/children/config.rb
Overview
CDN URL
Instance Method Summary collapse
Methods inherited from Instruction
Instance Method Details
#error_message ⇒ Object
106 107 108 109 110 111 |
# File 'lib/jekyll_picture_tag/instructions/children/config.rb', line 106 def <<~HEREDOC cdn_url must be a valid URI in the following format: https://example.com/ current setting: #{source} HEREDOC end |
#source ⇒ Object
94 95 96 |
# File 'lib/jekyll_picture_tag/instructions/children/config.rb', line 94 def source PictureTag.pconfig['cdn_url'] end |
#valid? ⇒ Boolean
98 99 100 101 102 103 104 |
# File 'lib/jekyll_picture_tag/instructions/children/config.rb', line 98 def valid? require 'uri' uri = URI(source) # If the URI library can't parse it, it's not valid. uri.scheme && uri.host end |