Class: Razor::Generable

Inherits:
Object
  • Object
show all
Defined in:
lib/razor/generable.rb

Direct Known Subclasses

Directory, GenerableFile

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#parentObject (readonly)

Returns the value of attribute parent.



9
10
11
# File 'lib/razor/generable.rb', line 9

def parent
  @parent
end

#src_nameObject (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

#destObject



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

#srcObject



18
19
20
# File 'lib/razor/generable.rb', line 18

def src
	@src ||= File.join(parent.src, src_name)
end

#urlObject



26
27
28
# File 'lib/razor/generable.rb', line 26

def url
	@url ||= File.join(parent.url, dest_name)
end