Class: ProxyRb::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/proxy_rb/resource.rb

Overview

A resource

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject

Returns the value of attribute content.



9
10
11
# File 'lib/proxy_rb/resource.rb', line 9

def content
  @content
end

#credentialsCredentials (readonly)

Return credentials from url

Returns:



20
21
22
# File 'lib/proxy_rb/resource.rb', line 20

def credentials
  @credentials
end

#urlObject (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_sString

Convert resource to url

Returns:

  • (String)

    url The url



28
29
30
# File 'lib/proxy_rb/resource.rb', line 28

def to_s
  url.to_s
end