Class: ServiceCall
- Inherits:
-
Object
- Object
- ServiceCall
- Defined in:
- lib/etvnet_seek/core/service_call.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(url) ⇒ ServiceCall
constructor
A new instance of ServiceCall.
- #post(params, headers) ⇒ Object
Constructor Details
#initialize(url) ⇒ ServiceCall
Returns a new instance of ServiceCall.
6 7 8 |
# File 'lib/etvnet_seek/core/service_call.rb', line 6 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/etvnet_seek/core/service_call.rb', line 4 def url @url end |
Instance Method Details
#get ⇒ Object
10 11 12 |
# File 'lib/etvnet_seek/core/service_call.rb', line 10 def get open(url) end |
#post(params, headers) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/etvnet_seek/core/service_call.rb', line 14 def post params, headers request = Net::HTTP::Post.new(url, headers) request.set_form_data(params) request(request) end |