Module: NfseSjc::Config
- Defined in:
- lib/nfse_sjc/config.rb
Class Method Summary collapse
Class Method Details
.default_attr(attr_name, env_path) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/nfse_sjc/config.rb', line 4 def self.default_attr(attr_name, env_path) attr_writer attr_name class_eval <<-RUBY def #{attr_name} @#{attr_name} ||= ENV['#{env_path}'] end RUBY end |
.to_h(at: nil) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/nfse_sjc/config.rb', line 21 def to_h(at: nil) %i(wsdl ssl_cert_file ssl_cert_key_file ssl_cert_key_password log pretty_print_xml xmlsec_binary_path).select do |prop| at.blank? || at.include?(prop) end.map do |meth| val = send(meth) [meth, val] if val end.compact.to_h end |