Module: FakeChargify::UrlParser
- Included in:
- CustomerRegistry, StatementRegistry, SubscriptionRegistry
- Defined in:
- lib/fake_chargify/url_parser.rb
Instance Method Summary collapse
Instance Method Details
#get_id_from_uri(uri) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/fake_chargify/url_parser.rb', line 3 def get_id_from_uri(uri) match = uri.path.match(/(\/\d.(xml|json)\z)/) if !match.nil? && match.size > 0 match = match[0].match(/\d/) return id = match[0].to_i if !match.nil? && match.size > 0 end end |