README.in_progress.md in pushradar-0.9.1 vs README.in_progress.md in pushradar-1.0.0

- old
+ new

@@ -1,23 +1,66 @@ -# PushRadarRuby +<p align="center"><img src="https://www.pushradar.com/img/logo/pushradar_github.png"></p> -TODO: Describe the gem +## Introduction +[PushRadar](https://www.pushradar.com) is a realtime notifications API service for the web. The service uses a simple publish-subscribe model, allowing you to broadcast "notifications" on "channels" that are subscribed to by one or more clients. Notifications are pushed in realtime to those clients. + +PushRadar features advanced targeting options, including the ability to target clients by actions they have taken on your website or web app, geographical location (countries & continents), IP address, web browser and user ID. + +This is PushRadar's official Ruby library. + +## Prerequisites + +In order to use this library, please ensure that you have the following: + +- A PushRadar account - you can sign up at [www.pushradar.com](https://www.pushradar.com). + ## Installation -Add this line to your application's Gemfile: +To install PushRadar's Ruby gem, add this line to your application's Gemfile: ```ruby gem 'pushradar' ``` And then execute: - $ bundle +``` +$ bundle +``` -Or install it yourself as: +Alternatively, you can install it yourself by running the command: - $ gem install pushradar +``` +$ gem install pushradar +``` -## Other Sections +## Getting Started -TODO: Write the other sections +"Hello World!" example: + +```ruby +require 'PushRadar' +include PushRadar + +radar = Radar.new('your-secret-key') +radar.broadcast('test-channel', {message: 'Hello World!'}) +``` + +## Receiving Notifications + +To subscribe to channels and receive notifications broadcast on them, check out the documentation for PushRadar's [JavaScript client library](https://www.pushradar.com/docs/latest/javascript). + +## Fluent Syntax + +The library supports fluent method chaining to structure broadcasts. For example, to target a notification to website visitors in the US who have not used live chat before: + +```ruby +radar.target_country('US').target_not_action('live-chat').broadcast('test-channel', + {message: 'Would you like to talk to one of our customer support team members on live chat?'}) +``` + +Please note that targeting options reset after each call to the `broadcast` method. + +## Documentation + +Full documentation for PushRadar's Ruby library can be found at: [www.pushradar.com/docs/ruby](https://www.pushradar.com/docs/latest/ruby). \ No newline at end of file