Class: GolfSwitch::CourseAvailTime

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#allowObject

Returns the value of attribute allow.



3
4
5
# File 'lib/golf_switch/course_avail_time.rb', line 3

def allow
  @allow
end

#chrg_currObject

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

#currObject

Returns the value of attribute curr.



3
4
5
# File 'lib/golf_switch/course_avail_time.rb', line 3

def curr
  @curr
end

#flagsObject

Returns the value of attribute flags.



3
4
5
# File 'lib/golf_switch/course_avail_time.rb', line 3

def flags
  @flags
end

#incObject

Returns the value of attribute inc.



3
4
5
# File 'lib/golf_switch/course_avail_time.rb', line 3

def inc
  @inc
end

#infoObject

Returns the value of attribute info.



3
4
5
# File 'lib/golf_switch/course_avail_time.rb', line 3

def info
  @info
end

#pp_chargeObject 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_rtObject

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_refObject

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_priceObject 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_priceObject

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_ptsObject

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_feeObject

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_freeObject

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

#tmObject

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_playerObject



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_playerObject



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_playerObject



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