Class: GolfSwitch::CourseInfo
- Defined in:
- lib/golf_switch/course_info.rb
Instance Attribute Summary collapse
-
#api_response ⇒ Object
Returns the value of attribute api_response.
-
#course_id ⇒ Object
Returns the value of attribute course_id.
Attributes inherited from Request
#client, #config, #request, #response, #soap_error
Instance Method Summary collapse
- #commit ⇒ Object
- #get_options ⇒ Object
-
#initialize(course_id) ⇒ CourseInfo
constructor
A new instance of CourseInfo.
- #parse_error ⇒ Object
- #parse_response ⇒ Object
Methods inherited from Request
#error?, #error_message, #get_authentication_header
Constructor Details
#initialize(course_id) ⇒ CourseInfo
Returns a new instance of CourseInfo.
5 6 7 |
# File 'lib/golf_switch/course_info.rb', line 5 def initialize(course_id) @course_id = course_id end |
Instance Attribute Details
#api_response ⇒ Object
Returns the value of attribute api_response.
3 4 5 |
# File 'lib/golf_switch/course_info.rb', line 3 def api_response @api_response end |
#course_id ⇒ Object
Returns the value of attribute course_id.
3 4 5 |
# File 'lib/golf_switch/course_info.rb', line 3 def course_id @course_id end |
Instance Method Details
#commit ⇒ Object
17 18 19 |
# File 'lib/golf_switch/course_info.rb', line 17 def commit super("course_info") end |
#get_options ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/golf_switch/course_info.rb', line 9 def { "Req"=>{ "CourseId"=>@course_id } } end |
#parse_error ⇒ Object
21 22 23 |
# File 'lib/golf_switch/course_info.rb', line 21 def parse_error @response[:course_info_response][:course_info_result] end |
#parse_response ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/golf_switch/course_info.rb', line 25 def parse_response begin unless error? @api_response = CourseInfoCourse.parse_course(@response[:course_info_response][:course_info_result]) else puts "Error #{}" end rescue puts "Error On Parsing Response" end end |