Class: Flutterwave::IP
- Inherits:
-
Object
- Object
- Flutterwave::IP
- Defined in:
- lib/flutterwave/ip.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #check(options = {}) ⇒ Object
-
#initialize(client) ⇒ IP
constructor
A new instance of IP.
- #post(url, data) ⇒ Object
Constructor Details
#initialize(client) ⇒ IP
Returns a new instance of IP.
5 6 7 |
# File 'lib/flutterwave/ip.rb', line 5 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/flutterwave/ip.rb', line 3 def client @client end |
Instance Method Details
#check(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/flutterwave/ip.rb', line 9 def check( = {}) raise Flutterwave::Utils::MissingKeyError.new( 'IP key required!' ) unless [:ip] response = post( Flutterwave::Utils::Constants::IP[:check_url], ip: [:ip] ) Flutterwave::Response.new(response) end |
#post(url, data) ⇒ Object
22 23 24 |
# File 'lib/flutterwave/ip.rb', line 22 def post(url, data) Flutterwave::Utils::NetworkManager.post(url, data) end |