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.
-
#product_info ⇒ Object
Returns the value of attribute product_info.
-
#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
- #namespace ⇒ 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 |
#product_info ⇒ Object
Returns the value of attribute product_info
5 6 7 |
# File 'lib/bookbinder/values/section.rb', line 5 def product_info @product_info 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
26 27 28 |
# File 'lib/bookbinder/values/section.rb', line 26 def destination_directory Ingest::DestinationDirectory.new(full_name, desired_directory_name) end |
#namespace ⇒ Object
34 35 36 |
# File 'lib/bookbinder/values/section.rb', line 34 def namespace destination_directory.to_s.gsub(%r{[./]}, '_') end |
#path_to_preprocessor_attribute(attr) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/bookbinder/values/section.rb', line 42 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
18 19 20 |
# File 'lib/bookbinder/values/section.rb', line 18 def path_to_repo_dir at_repo_path.nil? ? path_to_repository : path_to_repository.join(at_repo_path) end |
#subnav ⇒ Object
30 31 32 |
# File 'lib/bookbinder/values/section.rb', line 30 def {namespace => } end |
#subnav_name ⇒ Object
38 39 40 |
# File 'lib/bookbinder/values/section.rb', line 38 def || || 'default' end |
#subnav_template ⇒ Object
22 23 24 |
# File 'lib/bookbinder/values/section.rb', line 22 def .sub(/^_/, '').sub(/\.erb$/, '') if end |