Sha256: a9ec387dbae9ea4c1d84b49e47dfd53ad1f508a82424d7885e8a3932d2bc1864

Contents?: true

Size: 490 Bytes

Versions: 8

Compression:

Stored size: 490 Bytes

Contents

module Extface
  module DevicesHelper
    
    def subdrivers(options, object)
      object.subclasses.each do |s|
        options << [s::NAME, s.name]
        subdrivers(options, s) if s.subclasses.any?
      end
      return options
    end
    
    def options_for_drivers
      Extface::Engine.eager_load!
      {}.tap do |drivers|
        Extface::DriverBase.subclasses.collect{ |type|
          drivers[type::GROUP] = subdrivers(Array.new, type)
        }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
extface-0.1.0 app/helpers/extface/devices_helper.rb
extface-0.0.8 app/helpers/extface/devices_helper.rb
extface-0.0.7 app/helpers/extface/devices_helper.rb
extface-0.0.6 app/helpers/extface/devices_helper.rb
extface-0.0.5 app/helpers/extface/devices_helper.rb
extface-0.0.3 app/helpers/extface/devices_helper.rb
extface-0.0.2 app/helpers/extface/devices_helper.rb
extface-0.0.1 app/helpers/extface/devices_helper.rb