Class: Ekispert::Information
- Inherits:
-
EkispertBase
- Object
- EkispertBase
- Ekispert::Information
- Defined in:
- lib/ekispert/information.rb,
lib/ekispert/information/exit.rb,
lib/ekispert/information/line.rb,
lib/ekispert/information/corporation.rb,
lib/ekispert/information/welfare_facilities.rb
Defined Under Namespace
Classes: Corporation, Exit, Line, Type, WelfareFacilities
Instance Attribute Summary collapse
-
#corporation_list ⇒ Object
Returns the value of attribute corporation_list.
-
#exit_list ⇒ Object
Returns the value of attribute exit_list.
-
#line_list ⇒ Object
Returns the value of attribute line_list.
-
#type_list ⇒ Object
Returns the value of attribute type_list.
-
#welfare_facilities_list ⇒ Object
Returns the value of attribute welfare_facilities_list.
Class Method Summary collapse
Instance Method Summary collapse
- #exit? ⇒ Boolean
-
#initialize(element) ⇒ Information
constructor
A new instance of Information.
- #nearrail? ⇒ Boolean
- #rail? ⇒ Boolean
- #relate_line_and_corporation ⇒ Object
- #type ⇒ Object
- #welfare? ⇒ Boolean
Methods included from Util
Constructor Details
#initialize(element) ⇒ Information
Returns a new instance of Information.
5 6 7 8 9 10 11 12 13 |
# File 'lib/ekispert/information.rb', line 5 def initialize(element) @line_list = [] @corporation_list = [] @welfare_facilities_list = [] @exit_list = [] @type_list = [] super(element) relate_line_and_corporation end |
Instance Attribute Details
#corporation_list ⇒ Object
Returns the value of attribute corporation_list.
3 4 5 |
# File 'lib/ekispert/information.rb', line 3 def corporation_list @corporation_list end |
#exit_list ⇒ Object
Returns the value of attribute exit_list.
3 4 5 |
# File 'lib/ekispert/information.rb', line 3 def exit_list @exit_list end |
#line_list ⇒ Object
Returns the value of attribute line_list.
3 4 5 |
# File 'lib/ekispert/information.rb', line 3 def line_list @line_list end |
#type_list ⇒ Object
Returns the value of attribute type_list.
3 4 5 |
# File 'lib/ekispert/information.rb', line 3 def type_list @type_list end |
#welfare_facilities_list ⇒ Object
Returns the value of attribute welfare_facilities_list.
3 4 5 |
# File 'lib/ekispert/information.rb', line 3 def welfare_facilities_list @welfare_facilities_list end |
Class Method Details
Instance Method Details
#exit? ⇒ Boolean
42 43 44 |
# File 'lib/ekispert/information.rb', line 42 def exit? type == 'exit' end |
#nearrail? ⇒ Boolean
34 35 36 |
# File 'lib/ekispert/information.rb', line 34 def nearrail? type == 'nearrail' end |
#rail? ⇒ Boolean
30 31 32 |
# File 'lib/ekispert/information.rb', line 30 def rail? type == 'rail' end |
#relate_line_and_corporation ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ekispert/information.rb', line 15 def relate_line_and_corporation # Set Information::Line#corporation @line_list.each do |line| line.corporation = @corporation_list.find { |corp| corp.index == line.corporation_index } end # Set Information::Corporation#line_list @corporation_list.each do |corp| corp.line_list = @line_list.select { |line| corp.index == line.corporation_index } end end |
#type ⇒ Object
26 27 28 |
# File 'lib/ekispert/information.rb', line 26 def type @type_list[0].text end |
#welfare? ⇒ Boolean
38 39 40 |
# File 'lib/ekispert/information.rb', line 38 def welfare? type == 'welfare' end |