Class: Transport::Connection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Connection

Returns a new instance of Connection.



14
15
16
17
18
19
20
21
22
23
# File 'lib/connection.rb', line 14

def initialize(connection)
  @from = Checkpoint.new connection['from']
  @to = Checkpoint.new connection['to']
  @duration = Duration.new connection['duration']
  @service = Service.new connection['service']
  @products = connection['products']
  @capacity1st = connection['capacity1st']
  @capacity2nd = connection['capacity2nd']
  @sections = connection['sections'].map { |section| Section .new section }
end

Instance Attribute Details

#capacity1stObject (readonly)

Returns the value of attribute capacity1st.



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

def capacity1st
  @capacity1st
end

#capacity2ndObject (readonly)

Returns the value of attribute capacity2nd.



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

def capacity2nd
  @capacity2nd
end

#durationObject (readonly)

Returns the value of attribute duration.



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

def duration
  @duration
end

#fromObject (readonly)

Returns the value of attribute from.



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

def from
  @from
end

#productsObject (readonly)

Returns the value of attribute products.



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

def products
  @products
end

#sectionsObject (readonly)

Returns the value of attribute sections.



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

def sections
  @sections
end

#serviceObject (readonly)

Returns the value of attribute service.



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

def service
  @service
end

#toObject (readonly)

Returns the value of attribute to.



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

def to
  @to
end