Class: FPM::Cookery::Source
- Inherits:
-
Object
- Object
- FPM::Cookery::Source
- Defined in:
- lib/fpm/cookery/source.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(url, options = nil) ⇒ Source
constructor
A new instance of Source.
- #local? ⇒ Boolean
- #path ⇒ Object
- #provider? ⇒ Boolean
- #to_s ⇒ Object
- #to_str ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(url, options = nil) ⇒ Source
Returns a new instance of Source.
8 9 10 11 12 13 14 |
# File 'lib/fpm/cookery/source.rb', line 8 def initialize(url, = nil) ||= {} @url = URI(url.to_s) @provider = [:with] @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/fpm/cookery/source.rb', line 6 def @options end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
6 7 8 |
# File 'lib/fpm/cookery/source.rb', line 6 def provider @provider end |
Instance Method Details
#local? ⇒ Boolean
20 21 22 |
# File 'lib/fpm/cookery/source.rb', line 20 def local? @url.scheme.to_s.downcase == 'file' end |
#path ⇒ Object
28 29 30 |
# File 'lib/fpm/cookery/source.rb', line 28 def path @url.path end |
#provider? ⇒ Boolean
16 17 18 |
# File 'lib/fpm/cookery/source.rb', line 16 def provider? !!@provider end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/fpm/cookery/source.rb', line 32 def to_s @url.to_s end |
#to_str ⇒ Object
36 37 38 |
# File 'lib/fpm/cookery/source.rb', line 36 def to_str @url.to_s end |
#url ⇒ Object
24 25 26 |
# File 'lib/fpm/cookery/source.rb', line 24 def url @url.to_s end |