Module: Rubix::Associations::BelongsToHost

Included in:
Rubix::Application, Item, Trigger, UserMacro
Defined in:
lib/rubix/associations/belongs_to_host.rb

Instance Method Summary collapse

Instance Method Details

#hostObject



12
13
14
15
16
# File 'lib/rubix/associations/belongs_to_host.rb', line 12

def host
  return @host if @host
  return unless @host_id
  @host = Host.find(:id => @host_id)
end

#host=(h) ⇒ Object



6
7
8
9
10
# File 'lib/rubix/associations/belongs_to_host.rb', line 6

def host= h
  return unless h
  @host    = h
  @host_id = h.id
end

#host_idObject



23
24
25
26
27
# File 'lib/rubix/associations/belongs_to_host.rb', line 23

def host_id
  return @host_id if @host_id
  return unless @host
  @host_id = @host.id
end

#host_id=(hid) ⇒ Object



18
19
20
21
# File 'lib/rubix/associations/belongs_to_host.rb', line 18

def host_id= hid
  return unless hid
  @host_id = hid
end