Class: Thinreports::BasicReport::Core::Shape::List::Format
- Inherits:
-
Basic::Format
- Object
- Format::Base
- Basic::Format
- Thinreports::BasicReport::Core::Shape::List::Format
- Defined in:
- lib/thinreports/basic_report/core/shape/list/format.rb
Instance Attribute Summary collapse
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
Instance Method Summary collapse
- #has_section?(section_name) ⇒ Boolean
-
#initialize ⇒ Format
constructor
A new instance of Format.
- #section(section_name) ⇒ Hash deprecated Deprecated.
- #section_base_position_top(section_name) ⇒ Numeric
- #section_height(section_name) ⇒ Numeric
Methods inherited from Basic::Format
Methods included from Utils
#blank_value?, #call_block_in, #deep_copy, included
Methods inherited from Format::Base
#attributes, config_accessor, config_checker, config_reader, config_writer
Constructor Details
#initialize ⇒ Format
Returns a new instance of Format.
30 31 32 33 |
# File 'lib/thinreports/basic_report/core/shape/list/format.rb', line 30 def initialize(*) super initialize_sections end |
Instance Attribute Details
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
28 29 30 |
# File 'lib/thinreports/basic_report/core/shape/list/format.rb', line 28 def sections @sections end |
Instance Method Details
#has_section?(section_name) ⇒ Boolean
44 45 46 |
# File 'lib/thinreports/basic_report/core/shape/list/format.rb', line 44 def has_section?(section_name) section_name == :detail ? true : __send__(:"has_#{section_name}?") end |
#section(section_name) ⇒ Hash
Deprecated.
38 39 40 |
# File 'lib/thinreports/basic_report/core/shape/list/format.rb', line 38 def section(section_name) __send__(section_name) end |
#section_base_position_top(section_name) ⇒ Numeric
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/thinreports/basic_report/core/shape/list/format.rb', line 56 def section_base_position_top(section_name) section = @sections[section_name] return 0 unless has_section?(section_name) top = section.relative_top case section_name when :page_footer top - section_height(:detail) when :footer top - section_height(:detail) - section_height(:page_footer) else top end end |
#section_height(section_name) ⇒ Numeric
50 51 52 |
# File 'lib/thinreports/basic_report/core/shape/list/format.rb', line 50 def section_height(section_name) has_section?(section_name) ? __send__(:"#{section_name}_height") : 0 end |