Sha256: 9b50f2195553d7a2ed1243315036c7ca0f3fad00c9d82bd5bbac87cc62a72eb4

Contents?: true

Size: 435 Bytes

Versions: 2

Compression:

Stored size: 435 Bytes

Contents

require 'outliers/resources/aws'
 
module Outliers
  module Resources
    module_function

    def find_by_name(name)
      l = resources.select {|m| m.to_human == name }
      l.any? ? l.first : nil
    end

    def collections
      all_the_modules.select {|m| (m.is_a? Class) && (m.to_s =~ /Collection$/)}
    end

    def resources
      all_the_modules.select {|m| (m.is_a? Class) && !(m.to_s =~ /Collection$/)}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
outliers-0.6.0 lib/outliers/resources.rb
outliers-0.5.1 lib/outliers/resources.rb