lib/twitter/rate_limit_status.rb
# Creates a new rate limi status from a piece of xml
Creates a new rate limi status from a piece of xml
Creates a new rate limi status from a piece of xml
def new_from_xml(xml)
        RateLimitStatus.new do |s|
          s.reset_time_in_seconds = xml.at('reset-time-in-seconds').inner_html.to_i
          s.reset_time            = Time.parse xml.at('reset-time').inner_html
          s.remaining_hits        = xml.at('remaining-hits').inner_html.to_i
          s.hourly_limit          = xml.at('hourly-limit').inner_html.to_i
        end
      end
def new_from_xml ( xml ) RateLimitStatus . new do | s | s . reset_time_in_seconds = xml . at ( 'reset-time-in-seconds' ) . inner_html . to_i s . reset_time = Time . parse xml . at ( 'reset-time' ) . inner_html s . remaining_hits = xml . at ( 'remaining-hits' ) . inner_html . to_i s . hourly_limit = xml . at ( 'hourly-limit' ) . inner_html . to_i end end
Creates a new rate limi status from a piece of xml
Creates a new rate limi status from a piece of xml
xml