Class: GolfSwitch::CourseAvailTime
- Inherits:
-
Object
- Object
- GolfSwitch::CourseAvailTime
- Defined in:
- lib/golf_switch/course_avail_time.rb
Instance Attribute Summary collapse
-
#allow ⇒ Object
Returns the value of attribute allow.
-
#chrg_curr ⇒ Object
Returns the value of attribute chrg_curr.
-
#curr ⇒ Object
Returns the value of attribute curr.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#inc ⇒ Object
Returns the value of attribute inc.
-
#info ⇒ Object
Returns the value of attribute info.
-
#pp_charge ⇒ Object
(also: #per_person_charge)
Returns the value of attribute pp_charge.
-
#pp_net_rt ⇒ Object
Returns the value of attribute pp_net_rt.
-
#pp_non_ref ⇒ Object
Returns the value of attribute pp_non_ref.
-
#pp_price ⇒ Object
(also: #per_person_price)
Returns the value of attribute pp_price.
-
#pp_reg_price ⇒ Object
Returns the value of attribute pp_reg_price.
-
#pp_rew_pts ⇒ Object
Returns the value of attribute pp_rew_pts.
-
#pp_txn_fee ⇒ Object
Returns the value of attribute pp_txn_fee.
-
#pp_txn_free ⇒ Object
Returns the value of attribute pp_txn_free.
-
#tm ⇒ Object
Returns the value of attribute tm.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ CourseAvailTime
constructor
A new instance of CourseAvailTime.
- #max_player ⇒ Object
- #min_player ⇒ Object
- #no_of_allowed_player ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ CourseAvailTime
Returns a new instance of CourseAvailTime.
6 7 8 9 10 11 12 |
# File 'lib/golf_switch/course_avail_time.rb', line 6 def initialize(attributes={}) attributes.each do |name, value| begin send("#{name}=", value) end end end |
Instance Attribute Details
#allow ⇒ Object
Returns the value of attribute allow.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def allow @allow end |
#chrg_curr ⇒ Object
Returns the value of attribute chrg_curr.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def chrg_curr @chrg_curr end |
#curr ⇒ Object
Returns the value of attribute curr.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def curr @curr end |
#flags ⇒ Object
Returns the value of attribute flags.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def flags @flags end |
#inc ⇒ Object
Returns the value of attribute inc.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def inc @inc end |
#info ⇒ Object
Returns the value of attribute info.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def info @info end |
#pp_charge ⇒ Object Also known as: per_person_charge
Returns the value of attribute pp_charge.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_charge @pp_charge end |
#pp_net_rt ⇒ Object
Returns the value of attribute pp_net_rt.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_net_rt @pp_net_rt end |
#pp_non_ref ⇒ Object
Returns the value of attribute pp_non_ref.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_non_ref @pp_non_ref end |
#pp_price ⇒ Object Also known as: per_person_price
Returns the value of attribute pp_price.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_price @pp_price end |
#pp_reg_price ⇒ Object
Returns the value of attribute pp_reg_price.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_reg_price @pp_reg_price end |
#pp_rew_pts ⇒ Object
Returns the value of attribute pp_rew_pts.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_rew_pts @pp_rew_pts end |
#pp_txn_fee ⇒ Object
Returns the value of attribute pp_txn_fee.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_txn_fee @pp_txn_fee end |
#pp_txn_free ⇒ Object
Returns the value of attribute pp_txn_free.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def pp_txn_free @pp_txn_free end |
#tm ⇒ Object
Returns the value of attribute tm.
3 4 5 |
# File 'lib/golf_switch/course_avail_time.rb', line 3 def tm @tm end |
Instance Method Details
#max_player ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/golf_switch/course_avail_time.rb', line 22 def max_player begin @allow.split("").rindex("Y")+1 rescue no_of_allowed_player end end |
#min_player ⇒ Object
17 18 19 20 |
# File 'lib/golf_switch/course_avail_time.rb', line 17 def min_player min_index = @allow.split("").index("N") min_index.blank? ? 1 : min_index+2 end |
#no_of_allowed_player ⇒ Object
13 14 15 |
# File 'lib/golf_switch/course_avail_time.rb', line 13 def no_of_allowed_player @allow.split("").count{|p| p=='Y'} end |