Class: Ekispert::Course::Price
- Inherits:
-
EkispertBase
- Object
- EkispertBase
- Ekispert::Course::Price
- Defined in:
- lib/ekispert/course/price.rb
Defined Under Namespace
Classes: Name, Oneway, Rate, RevisionStatus, RevisionStatusComment, Round, Type
Instance Attribute Summary collapse
-
#line_list ⇒ Object
Returns the value of attribute line_list.
-
#name_list ⇒ Object
Returns the value of attribute name_list.
-
#oneway_list ⇒ Object
Returns the value of attribute oneway_list.
-
#pass_status ⇒ Object
Returns the value of attribute pass_status.
-
#rate_list ⇒ Object
Returns the value of attribute rate_list.
-
#revision_status_comment_list ⇒ Object
Returns the value of attribute revision_status_comment_list.
-
#revision_status_list ⇒ Object
Returns the value of attribute revision_status_list.
-
#round_list ⇒ Object
Returns the value of attribute round_list.
-
#type_list ⇒ Object
Returns the value of attribute type_list.
Instance Method Summary collapse
- #charge? ⇒ Boolean
- #fare? ⇒ Boolean
-
#initialize(element = nil) ⇒ Price
constructor
A new instance of Price.
- #name ⇒ Object
- #oneway ⇒ Object
- #rate ⇒ Object
- #revision_status ⇒ Object
- #revision_status_comment ⇒ Object
- #round ⇒ Object
- #teiki? ⇒ Boolean
- #type ⇒ Object
Methods included from Util
Constructor Details
#initialize(element = nil) ⇒ Price
Returns a new instance of Price.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ekispert/course/price.rb', line 8 def initialize(element=nil) @name_list = [] @oneway_list = [] @rate_list = [] @round_list = [] @revision_status_list = [] @revision_status_comment_list = [] @type_list = [] @line_list = [] # Use Course#relate_price_to_line return if element.nil? super(element) end |
Instance Attribute Details
#line_list ⇒ Object
Returns the value of attribute line_list.
6 7 8 |
# File 'lib/ekispert/course/price.rb', line 6 def line_list @line_list end |
#name_list ⇒ Object
Returns the value of attribute name_list.
4 5 6 |
# File 'lib/ekispert/course/price.rb', line 4 def name_list @name_list end |
#oneway_list ⇒ Object
Returns the value of attribute oneway_list.
4 5 6 |
# File 'lib/ekispert/course/price.rb', line 4 def oneway_list @oneway_list end |
#pass_status ⇒ Object
Returns the value of attribute pass_status.
6 7 8 |
# File 'lib/ekispert/course/price.rb', line 6 def pass_status @pass_status end |
#rate_list ⇒ Object
Returns the value of attribute rate_list.
4 5 6 |
# File 'lib/ekispert/course/price.rb', line 4 def rate_list @rate_list end |
#revision_status_comment_list ⇒ Object
Returns the value of attribute revision_status_comment_list.
5 6 7 |
# File 'lib/ekispert/course/price.rb', line 5 def revision_status_comment_list @revision_status_comment_list end |
#revision_status_list ⇒ Object
Returns the value of attribute revision_status_list.
5 6 7 |
# File 'lib/ekispert/course/price.rb', line 5 def revision_status_list @revision_status_list end |
#round_list ⇒ Object
Returns the value of attribute round_list.
4 5 6 |
# File 'lib/ekispert/course/price.rb', line 4 def round_list @round_list end |
#type_list ⇒ Object
Returns the value of attribute type_list.
5 6 7 |
# File 'lib/ekispert/course/price.rb', line 5 def type_list @type_list end |
Instance Method Details
#charge? ⇒ Boolean
54 55 56 |
# File 'lib/ekispert/course/price.rb', line 54 def charge? kind == 'Charge' end |
#fare? ⇒ Boolean
50 51 52 |
# File 'lib/ekispert/course/price.rb', line 50 def fare? kind == 'Fare' end |
#name ⇒ Object
22 23 24 |
# File 'lib/ekispert/course/price.rb', line 22 def name @name_list[0]&.text end |
#oneway ⇒ Object
26 27 28 |
# File 'lib/ekispert/course/price.rb', line 26 def oneway @oneway_list[0]&.text.to_i end |
#rate ⇒ Object
30 31 32 |
# File 'lib/ekispert/course/price.rb', line 30 def rate @rate_list[0]&.text.to_i end |
#revision_status ⇒ Object
38 39 40 |
# File 'lib/ekispert/course/price.rb', line 38 def revision_status @revision_status_list[0]&.text end |
#revision_status_comment ⇒ Object
42 43 44 |
# File 'lib/ekispert/course/price.rb', line 42 def revision_status_comment @revision_status_comment_list[0]&.text end |
#round ⇒ Object
34 35 36 |
# File 'lib/ekispert/course/price.rb', line 34 def round @round_list[0]&.text.to_i end |
#teiki? ⇒ Boolean
58 59 60 |
# File 'lib/ekispert/course/price.rb', line 58 def teiki? kind.match?(/^Teiki\d{1,2}$/) end |
#type ⇒ Object
46 47 48 |
# File 'lib/ekispert/course/price.rb', line 46 def type @type_list[0]&.text end |