Sha256: 504e1fd0561c5f8417f4ab7983a5b4b7b52869a50c8805e07a11924c2e197b4d

Contents?: true

Size: 713 Bytes

Versions: 8

Compression:

Stored size: 713 Bytes

Contents

module Mizuho

class Chapter
	# This may be nil, indicating that this chapter is the preamble.
	attr_accessor :heading
	attr_accessor :filename
	attr_accessor :contents
	
	def is_preamble?
		return heading.nil?
	end
	
	def title
		if @heading
			return @heading.title
		else
			return nil
		end
	end
	
	def title_without_numbers
		if @heading
			return @heading.title_without_numbers
		else
			return nil
		end
	end
	
	def plain_title
		if @heading
			return @heading.plain_title
		else
			return nil
		end
	end
	
	def basename
		return File.basename(filename)
	end
	
	def anchor
		if @heading
			return @heading.anchor
		else
			return nil
		end
	end
	
	def anchor_id
		return anchor.sub(/^#/, '')
	end
end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
FooBarWidget-mizuho-0.9.0 lib/mizuho/chapter.rb
FooBarWidget-mizuho-0.9.1 lib/mizuho/chapter.rb
FooBarWidget-mizuho-0.9.2 lib/mizuho/chapter.rb
FooBarWidget-mizuho-0.9.3 lib/mizuho/chapter.rb
FooBarWidget-mizuho-0.9.4 lib/mizuho/chapter.rb
FooBarWidget-mizuho-0.9.5 lib/mizuho/chapter.rb
mizuho-0.9.8 lib/mizuho/chapter.rb
mizuho-0.9.6 lib/mizuho/chapter.rb