Class: Terraspace::Tester::Finder

Inherits:
Object
  • Object
show all
Defined in:
lib/terraspace/tester/finder.rb

Instance Method Summary collapse

Instance Method Details

#find_with(options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/terraspace/tester/finder.rb', line 3

def find_with(options)
  result = if options.key?(:framework)
             find_with_framework(options[:framework])
           else
             raise "Must provide framework_name option."
           end

  return unless result
  raw = Hash[*result] # convert result to Hash instead of an Array
  Meta.new(raw)
end

#find_with_framework(framework) ⇒ Object



15
16
17
18
19
# File 'lib/terraspace/tester/finder.rb', line 15

def find_with_framework(framework)
  meta.find do |framework_name, data|
    framework_name == framework
  end
end

#metaObject



21
22
23
# File 'lib/terraspace/tester/finder.rb', line 21

def meta
  Terraspace::Tester.meta
end