Class: ProxyRb::Resource
- Inherits:
-
Object
- Object
- ProxyRb::Resource
- Defined in:
- lib/proxy_rb/resource.rb
Overview
A resource
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#credentials ⇒ Credentials
readonly
Return credentials from url.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ Resource
constructor
A new instance of Resource.
-
#to_s ⇒ String
Convert resource to url.
Constructor Details
#initialize(url) ⇒ Resource
Returns a new instance of Resource.
12 13 14 |
# File 'lib/proxy_rb/resource.rb', line 12 def initialize(url) @url = Addressable::URI.parse(url) end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
9 10 11 |
# File 'lib/proxy_rb/resource.rb', line 9 def content @content end |
#credentials ⇒ Credentials (readonly)
Return credentials from url
20 21 22 |
# File 'lib/proxy_rb/resource.rb', line 20 def credentials @credentials end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/proxy_rb/resource.rb', line 10 def url @url end |
Instance Method Details
#to_s ⇒ String
Convert resource to url
28 29 30 |
# File 'lib/proxy_rb/resource.rb', line 28 def to_s url.to_s end |