Module: Noah::SinatraHelpers

Extended by:
Ohm
Defined in:
lib/noah/helpers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) application(opts = {})



40
41
42
# File 'lib/noah/helpers.rb', line 40

def application(opts = {})
  Application.find(opts).first
end

- (Object) applications(opts = {})



44
45
46
# File 'lib/noah/helpers.rb', line 44

def applications(opts = {})
  Applications.all(opts)
end

- (Object) configuration(opts = {})



48
49
50
# File 'lib/noah/helpers.rb', line 48

def configuration(opts = {})
  Configuration.find(opts).first
end

- (Object) configurations(opts = {})



52
53
54
# File 'lib/noah/helpers.rb', line 52

def configurations(opts = {})
  Configurations.all(opts)
end

- (Object) host(opts = {})



6
7
8
# File 'lib/noah/helpers.rb', line 6

def host(opts = {})
 Host.find(opts).first
end

- (Object) host_service(hostname, servicename)



22
23
24
25
26
27
28
29
# File 'lib/noah/helpers.rb', line 22

def host_service(hostname, servicename)
  h = Host.find(:name => hostname).first
  if h.nil?
    nil
  else  
    Service.find(:host_id => h.id, :name => servicename).first
  end  
end

- (Object) host_services(hostname)



31
32
33
34
35
36
37
38
# File 'lib/noah/helpers.rb', line 31

def host_services(hostname)
  h = Host.find(:name => hostname).first
  if h.nil?
    nil
  else  
    Services.all(:host_id => id)
  end  
end

- (Object) hosts(opts = {})



10
11
12
# File 'lib/noah/helpers.rb', line 10

def hosts(opts = {})
  Hosts.all(opts)
end

- (Object) service(opts = {})



14
15
16
# File 'lib/noah/helpers.rb', line 14

def service(opts = {})
  Service.find(options)
end

- (Object) services(opts = {})



18
19
20
# File 'lib/noah/helpers.rb', line 18

def services(opts = {})
  Services.all(opts)
end