Class: Transporter::Package

Inherits:
Object
  • Object
show all
Includes:
Ninja
Defined in:
lib/transporter/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(package) ⇒ Package

Returns a new instance of Package.



7
8
9
10
11
12
# File 'lib/transporter/package.rb', line 7

def initialize(package)
  message = package.fetch(:message)
  @short = message.fetch(:short)
  @full = message.fetch(:full)
  @services = package.fetch(:using)
end

Instance Attribute Details

#fullObject (readonly)

Returns the value of attribute full.



5
6
7
# File 'lib/transporter/package.rb', line 5

def full
  @full
end

#shortObject (readonly)

Returns the value of attribute short.



5
6
7
# File 'lib/transporter/package.rb', line 5

def short
  @short
end

Instance Method Details

#deliverObject



14
15
16
17
18
# File 'lib/transporter/package.rb', line 14

def deliver
  delivery_services.each do |service|
    in_background { service.deliver(self) }
  end
end