Sha256: 20f1794abad4dc4210a0467754587a288477042fd51aba2bca2d01c5fda8bf78

Contents?: true

Size: 986 Bytes

Versions: 13

Compression:

Stored size: 986 Bytes

Contents

module BrDanfe
  module DanfeLib
    module NfceLib
      class Document
        def initialize(page_width, page_height)
          @document = BrDanfe::DocumentBuilder.build(
            page_size: [page_width, page_height],
            page_layout: :portrait,
            left_margin: 0.3.cm,
            right_margin: 0.3.cm,
            top_margin: 0.3.cm,
            botton_margin: 0
          )

          @document.font 'tinos'
          @document.line_width = 0.3
        end

        def render_blank_line(font_size = 6)
          @document.text ' ', size: font_size
        end

        def method_missing(method_name, *args, &block)
          if @document.respond_to? method_name
            @document.send method_name, *args, &block
          else
            super
          end
        end

        def respond_to_missing?(method_name, include_private = false)
          @document.respond_to?(method_name, include_private) || super
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
br_danfe-1.0.0 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.20.0 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.19.0 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.18.0 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.8 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.7 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.6 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.5 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.4 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.3 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.2 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.1 lib/br_danfe/danfe_lib/nfce_lib/document.rb
br_danfe-0.17.0 lib/br_danfe/danfe_lib/nfce_lib/document.rb