Class: Transport::Connection
- Inherits:
-
Object
- Object
- Transport::Connection
- Defined in:
- lib/connection.rb
Instance Attribute Summary collapse
-
#capacity1st ⇒ Object
readonly
Returns the value of attribute capacity1st.
-
#capacity2nd ⇒ Object
readonly
Returns the value of attribute capacity2nd.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#products ⇒ Object
readonly
Returns the value of attribute products.
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(connection) ⇒ Connection
constructor
A new instance of Connection.
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
#capacity1st ⇒ Object (readonly)
Returns the value of attribute capacity1st.
12 13 14 |
# File 'lib/connection.rb', line 12 def capacity1st @capacity1st end |
#capacity2nd ⇒ Object (readonly)
Returns the value of attribute capacity2nd.
12 13 14 |
# File 'lib/connection.rb', line 12 def capacity2nd @capacity2nd end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
12 13 14 |
# File 'lib/connection.rb', line 12 def duration @duration end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
12 13 14 |
# File 'lib/connection.rb', line 12 def from @from end |
#products ⇒ Object (readonly)
Returns the value of attribute products.
12 13 14 |
# File 'lib/connection.rb', line 12 def products @products end |
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
12 13 14 |
# File 'lib/connection.rb', line 12 def sections @sections end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
12 13 14 |
# File 'lib/connection.rb', line 12 def service @service end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
12 13 14 |
# File 'lib/connection.rb', line 12 def to @to end |