Class: Bookbinder::Section
- Inherits:
-
Struct
- Object
- Struct
- Bookbinder::Section
- Defined in:
- lib/bookbinder/values/section.rb
Instance Attribute Summary collapse
-
#at_repo_path ⇒ Object
Returns the value of attribute at_repo_path.
-
#desired_directory_name ⇒ Object
Returns the value of attribute desired_directory_name.
-
#desired_subnav_name ⇒ Object
Returns the value of attribute desired_subnav_name.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#path_to_repository ⇒ Object
writeonly
Sets the attribute path_to_repository.
-
#pdf_output_filename ⇒ Object
Returns the value of attribute pdf_output_filename.
-
#preprocessor_config ⇒ Object
Returns the value of attribute preprocessor_config.
-
#repo_name ⇒ Object
Returns the value of attribute repo_name.
-
#source_ref ⇒ Object
Returns the value of attribute source_ref.
-
#subnav_templ ⇒ Object
Returns the value of attribute subnav_templ.
Instance Method Summary collapse
- #destination_directory ⇒ Object
- #path_to_preprocessor_attribute(attr) ⇒ Object
- #path_to_repo_dir ⇒ Object
- #subnav ⇒ Object
- #subnav_name ⇒ Object
- #subnav_template ⇒ Object
Instance Attribute Details
#at_repo_path ⇒ Object
Returns the value of attribute at_repo_path
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def at_repo_path @at_repo_path end |
#desired_directory_name ⇒ Object
Returns the value of attribute desired_directory_name
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def desired_directory_name @desired_directory_name end |
#desired_subnav_name ⇒ Object
Returns the value of attribute desired_subnav_name
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def @desired_subnav_name end |
#full_name ⇒ Object
Returns the value of attribute full_name
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def full_name @full_name end |
#path_to_repository=(value) ⇒ Object
Sets the attribute path_to_repository
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def path_to_repository=(value) @path_to_repository = value end |
#pdf_output_filename ⇒ Object
Returns the value of attribute pdf_output_filename
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def pdf_output_filename @pdf_output_filename end |
#preprocessor_config ⇒ Object
Returns the value of attribute preprocessor_config
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def preprocessor_config @preprocessor_config end |
#repo_name ⇒ Object
Returns the value of attribute repo_name
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def repo_name @repo_name end |
#source_ref ⇒ Object
Returns the value of attribute source_ref
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def source_ref @source_ref end |
#subnav_templ ⇒ Object
Returns the value of attribute subnav_templ
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def @subnav_templ end |
Instance Method Details
#destination_directory ⇒ Object
24 25 26 |
# File 'lib/bookbinder/values/section.rb', line 24 def destination_directory Ingest::DestinationDirectory.new(full_name, desired_directory_name) end |
#path_to_preprocessor_attribute(attr) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/bookbinder/values/section.rb', line 37 def path_to_preprocessor_attribute(attr) path_to_repo_dir.join(preprocessor_config[attr]) if preprocessor_config[attr] rescue NoMethodError => e raise Errors::ProgrammerMistake.new( "path_to_preprocessor_attribute assumes preprocessor_config is available, got nil.\n" + "Original exception:\n\n#{e.inspect}\n\n#{e.backtrace.join("\n")}" ) end |
#path_to_repo_dir ⇒ Object
16 17 18 |
# File 'lib/bookbinder/values/section.rb', line 16 def path_to_repo_dir at_repo_path.nil? ? path_to_repository : path_to_repository.join(at_repo_path) end |
#subnav ⇒ Object
28 29 30 31 |
# File 'lib/bookbinder/values/section.rb', line 28 def namespace = destination_directory.to_s.gsub('/', '_') {namespace => } end |
#subnav_name ⇒ Object
33 34 35 |
# File 'lib/bookbinder/values/section.rb', line 33 def || || 'default' end |
#subnav_template ⇒ Object
20 21 22 |
# File 'lib/bookbinder/values/section.rb', line 20 def .sub(/^_/, '').sub(/\.erb$/, '') if end |