Method: LabClient::Klass#help

Defined in:
lib/labclient/klass.rb

#help(help_filter = nil) ⇒ Object

API Methods here have to be explicitly documented / custom helpers Assume no methods by default



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/labclient/klass.rb', line 19

def help(help_filter = nil)
  docs = LabClient::Docs.docs.dig(group_name, 'Reference')
  unless docs
    puts 'No Available Help'
    return false
  end

  puts klass
  docs.each do |doc|
    next unless doc[:options]

    doc[:options].each do |opt|
      next if help_filter && !(opt[:name] + opt[:text]).include?(help_filter.to_s)

      puts "  #{opt[:name]}"
      puts "    #{opt[:text]}\n"
    end
  end

  # Ignore Output
  nil
end