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.



16
17
18
# File 'lib/proxy_rb/resource.rb', line 16

def initialize(url)
  @url = Addressable::URI.parse(url)
end

Instance Attribute Details

#content ⇒ Object

Returns the value of attribute content.



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

def content
  @content
end

Instance Method Details

#to_url ⇒ String

Convert resource to url

Returns:

  • (String) —

    url The url



24
25
26
# File 'lib/proxy_rb/resource.rb', line 24

def to_url
  url.to_s
end