Class: Rubicante::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/rubicante/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Type

Returns a new instance of Type.



6
7
8
9
10
# File 'lib/rubicante/type.rb', line 6

def initialize(name)
  @name     = name
  @ports    = []
  @services = []
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/rubicante/type.rb', line 3

def name
  @name
end

#portsObject

Returns the value of attribute ports.



4
5
6
# File 'lib/rubicante/type.rb', line 4

def ports
  @ports
end

#servicesObject

Returns the value of attribute services.



4
5
6
# File 'lib/rubicante/type.rb', line 4

def services
  @services
end

Instance Method Details

#port(new_port) ⇒ Object



12
13
14
# File 'lib/rubicante/type.rb', line 12

def port(new_port)
  @ports << new_port
end

#service(new_service) ⇒ Object



16
17
18
# File 'lib/rubicante/type.rb', line 16

def service(new_service)
  @services << new_service
end