Class: Infostrada::Endpoint
- Inherits:
-
Object
- Object
- Infostrada::Endpoint
- Defined in:
- lib/infostrada/endpoint.rb
Instance Attribute Summary collapse
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#method ⇒ Object
Returns the value of attribute method.
-
#query_string ⇒ Object
Returns the value of attribute query_string.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Endpoint
constructor
A new instance of Endpoint.
-
#match_id ⇒ Object
Helper method to return the match id from the query string.
-
#phase_id ⇒ Object
Helper method to return the phase id from the query string.
Constructor Details
#initialize(hash) ⇒ Endpoint
Returns a new instance of Endpoint.
5 6 7 8 9 10 11 |
# File 'lib/infostrada/endpoint.rb', line 5 def initialize(hash) @method = hash['c_Method'] @last_modified = Formatter.format_date(hash['d_LastModified']) @query_string = hash['c_QueryString'] self end |
Instance Attribute Details
#last_modified ⇒ Object
Returns the value of attribute last_modified.
3 4 5 |
# File 'lib/infostrada/endpoint.rb', line 3 def last_modified @last_modified end |
#method ⇒ Object
Returns the value of attribute method.
3 4 5 |
# File 'lib/infostrada/endpoint.rb', line 3 def method @method end |
#query_string ⇒ Object
Returns the value of attribute query_string.
3 4 5 |
# File 'lib/infostrada/endpoint.rb', line 3 def query_string @query_string end |
Instance Method Details
#match_id ⇒ Object
Helper method to return the match id from the query string.
14 15 16 17 |
# File 'lib/infostrada/endpoint.rb', line 14 def match_id @query_string.match(/matchid=(\d+)/) $1 end |
#phase_id ⇒ Object
Helper method to return the phase id from the query string.
20 21 22 23 |
# File 'lib/infostrada/endpoint.rb', line 20 def phase_id @query_string.match(/phaseid=(\d+)/) $1 end |