Class: Razor::Generable
- Inherits:
-
Object
- Object
- Razor::Generable
- Defined in:
- lib/razor/generable.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#src_name ⇒ Object
(also: #dest_name)
readonly
Returns the value of attribute src_name.
Instance Method Summary collapse
- #dest ⇒ Object
- #http(url) ⇒ Object
-
#initialize(parent, src_name) ⇒ Generable
constructor
A new instance of Generable.
- #src ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(parent, src_name) ⇒ Generable
Returns a new instance of Generable.
11 12 13 14 |
# File 'lib/razor/generable.rb', line 11 def initialize(parent, src_name) @parent = parent @src_name = src_name end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
9 10 11 |
# File 'lib/razor/generable.rb', line 9 def parent @parent end |
#src_name ⇒ Object (readonly) Also known as: dest_name
Returns the value of attribute src_name.
9 10 11 |
# File 'lib/razor/generable.rb', line 9 def src_name @src_name end |
Instance Method Details
#dest ⇒ Object
22 23 24 |
# File 'lib/razor/generable.rb', line 22 def dest @dest ||= File.join(parent.dest, dest_name) end |
#http(url) ⇒ Object
30 31 32 33 |
# File 'lib/razor/generable.rb', line 30 def http(url) url.empty? and return self return nil end |
#src ⇒ Object
18 19 20 |
# File 'lib/razor/generable.rb', line 18 def src @src ||= File.join(parent.src, src_name) end |
#url ⇒ Object
26 27 28 |
# File 'lib/razor/generable.rb', line 26 def url @url ||= File.join(parent.url, dest_name) end |