lib/about_page/environment.rb in about_page-0.1.1 vs lib/about_page/environment.rb in about_page-0.2.0

- old
+ new

@@ -1,19 +1,22 @@ module AboutPage class Environment < AboutPage::Configuration::Node attr_accessor :sections - delegate :each_pair, :to_json, :to_xml, :to => :to_h def initialize(sections = {}) self.sections = sections end + def env + ENV + end + def to_h @request_env ||= begin h = Hash.new { |h,k| h[k] = {} } - environment.each_pair do |key,value| + env.each_pair do |key,value| section = section_for(key,value) unless section.nil? h[section][key] = value if value.is_a? String end end @@ -27,12 +30,8 @@ else sections.keys.find do |k| key =~ sections[k] end end - end - - def environment - ENV end end end