Class: BrDanfe::MdfeLib::Document
- Inherits:
-
Object
- Object
- BrDanfe::MdfeLib::Document
- Defined in:
- lib/br_danfe/mdfe_lib/document.rb
Instance Method Summary collapse
-
#initialize ⇒ Document
constructor
A new instance of Document.
- #method_missing(method_name, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize ⇒ Document
Returns a new instance of Document.
4 5 6 7 8 9 10 11 |
# File 'lib/br_danfe/mdfe_lib/document.rb', line 4 def initialize @document = BrDanfe::DocumentBuilder.build( page_size: 'A4', page_layout: :portrait ) @document.font 'tinos' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/br_danfe/mdfe_lib/document.rb', line 13 def method_missing(method_name, *args, &block) if @document.respond_to? method_name @document.send method_name, *args, &block else super end end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
21 22 23 |
# File 'lib/br_danfe/mdfe_lib/document.rb', line 21 def respond_to_missing?(method_name, include_private = false) @document.respond_to?(method_name, include_private) || super end |