Class: Reefer::Pad
- Inherits:
-
Object
- Object
- Reefer::Pad
- Defined in:
- lib/reefer/pad.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(url) ⇒ Pad
constructor
A new instance of Pad.
- #revision(version) ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(url) ⇒ Pad
Returns a new instance of Pad.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/reefer/pad.rb', line 10 def initialize(url) url = URI.parse(url) @domain = url.host @name = url.path # remove the leading slash (which is always present), but explode # if any more are present. pad names can't contain them. @name.gsub!(/^\//, "") raise InvalidPadName\ if @name.index("/") end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
8 9 10 |
# File 'lib/reefer/pad.rb', line 8 def domain @domain end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/reefer/pad.rb', line 8 def name @name end |