Class: ServiceCall

Inherits:
Object
  • Object
show all
Defined in:
lib/etvnet_seek/core/service_call.rb

Direct Known Subclasses

AccessPage, LoginPage, Page

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#urlObject (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

#getObject



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