Sha256: a0cb66bea08bf84895f76de74c01fed378e8cd9d87e01dc0609039f4e59bbf90
Contents?: true
Size: 866 Bytes
Versions: 84
Compression:
Stored size: 866 Bytes
Contents
module Bhf class Settings def initialize(options) @options = options end def pages @options['pages'].each_with_object([]) do |page, obj| if page.is_a?(String) page = {page => nil} end obj << page.keys[0] end end def content_for_page(selected_page) @options['pages'].each do |page| page = {page => nil} if page.is_a?(String) if selected_page == page.keys[0] return page.values.flatten end end nil end def find_platform(platform_name, current_account = nil) pages.each do |page| content_for_page(page).each do |platform| bhf_platform = Bhf::Platform.new(platform, page, current_account) return bhf_platform if bhf_platform.name == platform_name end end end end end
Version data entries
84 entries across 84 versions & 1 rubygems
Version | Path |
---|---|
bhf-0.2.3 | lib/bhf/settings.rb |
bhf-0.2.2 | lib/bhf/settings.rb |
bhf-0.2.1 | lib/bhf/settings.rb |
bhf-0.2.0 | lib/bhf/settings.rb |