Sha256: ff7725047992b61443f71e7a5d4c9b5836bf13004502e8a82a3b563a13c2409a
Contents?: true
Size: 720 Bytes
Versions: 17
Compression:
Stored size: 720 Bytes
Contents
module BrDanfe module DanfeLib class LogoOptions def initialize(bounding_box_size, logo_dimensions) @bounding_box_size = bounding_box_size @logo_width = logo_dimensions[:width] @logo_height = logo_dimensions[:height] end def options logo_options = dimensions logo_options[:position] = :center logo_options[:vposition] = :center logo_options end private def dimensions @logo_width > @logo_height ? { width: calculate_size(@logo_width) } : { height: calculate_size(@logo_height) } end def calculate_size(size) size < @bounding_box_size ? size : @bounding_box_size end end end end
Version data entries
17 entries across 17 versions & 1 rubygems