Class: Wellness::System

Inherits:
Object
  • Object
show all
Defined in:
lib/wellness/system.rb

Overview

Author:

  • Matthew A. Johnston (warmwaffles)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ System

Returns a new instance of System.

Parameters:

  • name (String)

    the name of the system



9
10
11
12
13
# File 'lib/wellness/system.rb', line 9

def initialize(name)
  @name     = name
  @services = {}
  @details  = {}
end

Instance Attribute Details

#detailsObject (readonly)

Returns the value of attribute details.



6
7
8
# File 'lib/wellness/system.rb', line 6

def details
  @details
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/wellness/system.rb', line 6

def name
  @name
end

#servicesObject (readonly)

Returns the value of attribute services.



6
7
8
# File 'lib/wellness/system.rb', line 6

def services
  @services
end

Instance Method Details

#add_detail(name, detail) ⇒ Object



19
20
21
# File 'lib/wellness/system.rb', line 19

def add_detail(name, detail)
  @details[name] = detail
end

#add_service(name, service, options = {}) ⇒ Object



15
16
17
# File 'lib/wellness/system.rb', line 15

def add_service(name, service, options={})
  @services[name] = Wellness::Service.new(service, options)
end