Class: FacebookApp::InfographicServerCommunicator

Inherits:
Object
  • Object
show all
Defined in:
app/models/facebook_app/infographic_server_communicator.rb

Constant Summary collapse

INFOGRAPHIC_SERVER_PASSWORD =
"henry-hughes"
SERVER_IP =
"http://50.19.35.130"
SERVER_URL =
SERVER_IP + "/infographics"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ InfographicServerCommunicator

Returns a new instance of InfographicServerCommunicator.



12
13
14
# File 'app/models/facebook_app/infographic_server_communicator.rb', line 12

def initialize(options)
  @post_parameters = options.merge(:secret => INFOGRAPHIC_SERVER_PASSWORD)
end

Instance Attribute Details

#post_parametersObject (readonly)

Returns the value of attribute post_parameters.



10
11
12
# File 'app/models/facebook_app/infographic_server_communicator.rb', line 10

def post_parameters
  @post_parameters
end

Instance Method Details

#send_to_serverObject



16
17
18
# File 'app/models/facebook_app/infographic_server_communicator.rb', line 16

def send_to_server
  Net::HTTP.post_form(URI.parse(SERVER_URL), post_parameters)
end