Sha256: b3cdaa42767f517c776cfb55807060a1b104590c25495442a076856736d8aabf

Contents?: true

Size: 566 Bytes

Versions: 25

Compression:

Stored size: 566 Bytes

Contents

module BrDanfe
  module Logo
    class Config < OpenStruct
      DEFAULTOPTIONS = { logo: '', logo_dimensions: {} }.freeze

      def initialize(new_options = {})
        options = DEFAULTOPTIONS.merge(config_yaml_load)
        super options.merge(new_options)
      end

      private

      def file
        File.exist?('config/br_danfe.yml') ? File.open('config/br_danfe.yml').read : ''
      end

      def config_yaml_load
        @file_read = YAML.safe_load(file)
        @file_read ? (@file_read['br_danfe'] || {})['options'] : {}
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
br_danfe-0.19.0 lib/br_danfe/logo_config.rb
br_danfe-0.18.0 lib/br_danfe/logo_config.rb
br_danfe-0.17.8 lib/br_danfe/logo_config.rb
br_danfe-0.17.7 lib/br_danfe/logo_config.rb
br_danfe-0.17.6 lib/br_danfe/logo_config.rb
br_danfe-0.17.5 lib/br_danfe/logo_config.rb
br_danfe-0.17.4 lib/br_danfe/logo_config.rb
br_danfe-0.17.3 lib/br_danfe/logo_config.rb
br_danfe-0.17.2 lib/br_danfe/logo_config.rb
br_danfe-0.17.1 lib/br_danfe/logo_config.rb
br_danfe-0.17.0 lib/br_danfe/logo_config.rb
br_danfe-0.16.0 lib/br_danfe/logo_config.rb
br_danfe-0.15.1 lib/br_danfe/logo_config.rb
br_danfe-0.15.0 lib/br_danfe/logo_config.rb
br_danfe-0.14.5 lib/br_danfe/logo_config.rb
br_danfe-0.14.4 lib/br_danfe/logo_config.rb
br_danfe-0.14.3 lib/br_danfe/logo_config.rb
br_danfe-0.14.2 lib/br_danfe/logo_config.rb
br_danfe-0.14.0 lib/br_danfe/logo_config.rb
br_danfe-0.13.3 lib/br_danfe/logo_config.rb