Class: Serensic::Client
- Inherits:
-
Object
- Object
- Serensic::Client
- Defined in:
- lib/serensic.rb
Instance Attribute Summary collapse
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #send_message(params) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 |
# File 'lib/serensic.rb', line 14 def initialize( = {}) @user = .fetch(:user) { ENV.fetch('SERERNSIC_USER') } @secret = .fetch(:secret) { ENV.fetch('SERENSIC_SECRET') } @host = .fetch(:host) { 'http://app.serensic.com' } @user_agent = "serensic-ruby/#{VERSION} ruby/#{RUBY_VERSION}" end |
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret.
12 13 14 |
# File 'lib/serensic.rb', line 12 def secret @secret end |
#user ⇒ Object
Returns the value of attribute user.
12 13 14 |
# File 'lib/serensic.rb', line 12 def user @user end |
Instance Method Details
#send_message(params) ⇒ Object
21 22 23 |
# File 'lib/serensic.rb', line 21 def (params) post(@host, '/index.php?app=ws&op=pv&', params) end |