Permalink
Browse files

documentation update

  • Loading branch information...
1 parent 62e019e commit ac64c3641578c1ad01954ba0e64a8cf85b76e63b @heythisisnate committed Dec 18, 2011
Showing with 43 additions and 18 deletions.
  1. +1 −1 LICENSE
  2. +42 −17 README.md
View
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Nate Clark
+Copyright (c) 2011 Nate Clark, Irregular Expression LLC
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -14,13 +14,13 @@ This gem only supports a subset of Xignite's Web Services. **Currently Supported
gem install xignite
require 'xignite'
-with Bundler, simply:
+or with Bundler, simply add to your Gemfile:
gem 'xignite'
## Basic Usage ##
- *Xignite Ruby* provides a rubyist's interface to the Xignite API. It constructs a GET or POST request for you, and then parses the response into Array and Hash-like Ruby objects. Reference the Xignite documentation for required parameters and options, and call the appropriate Web Service in one of two ways:
+*Xignite Ruby* provides a rubyist's interface to the Xignite API. It constructs a GET or POST request for you, and then parses the response into Array and Hash-like Ruby objects. Reference the Xignite documentation for required parameters and options, then call the appropriate Web Service in one of two ways:
# The following two statements do the same thing
response = Xignite::Metals.get_last_real_time_metal_quote(
@@ -31,7 +31,7 @@ with Bundler, simply:
'Type' => 'XAU', 'Currency' => 'USD'
)
- The response is a `Xignite::Metals::GetLastRealTimeMetalQuote` object:
+The response is a `Xignite::Metals::GetLastRealTimeMetalQuote` object:
#<Xignite::Metals::GetLastRealTimeMetalQuote:0x007fbbc3a648f8
@metal_quote={
@@ -45,42 +45,45 @@ with Bundler, simply:
"time"=>2011-12-09 22:59:52 UTC,
"rate"=>1711.42498779,
"bid"=>1710.69995117,
- "bid_time"=>2011-12-09
- 22:59:52 UTC,
+ "bid_time"=>2011-12-09 22:59:52 UTC,
"ask"=>1712.15002441,
"ask_time"=>2011-12-09 22:59:52 UTC
}>
+Numeric values are automatically converted to `Float` objects
+
response.metal_quote['ask']
# => 1712.15002441
+Times are automatically converted into `DateTime` objects with the appropriate time zone (if known)
+
response.metal_quote['time']
# => 2011-12-09 22:59:52 UTC
+Dates are automatically converted into `Date` objects
+
+ response.metal_quote['date']
+ # => #<Date: 2011-12-09 (4911809/2,0,2299161)>
+
## Configuration ##
Xignite.configure do |config|
# Configure which HTTP method is used to contact the Xignite service
# Default: :get, Possible values: [ :get, :post ]
- #
- self.request_method = :get
+ config.request_method = :get
# Configure the endpoint hostname
# Default: www.xignite.com
- #
- self.endpoint = Xignite::URL
+ config.endpoint = Xignite::URL
# Use HTTPS
# Default: false
- #
- self.https = true
+ config.https = true
- # Set your Xignite username. This automatically adds a 'Header_Username' parameter to all requests
+ # Set your Xignite username. This automatically adds a 'Header_Username' parameter to all requests as required.
# Default: nil
- #
- self.username = 'goldbug'
-
+ config.username = 'goldbug'
end
## Contributing ##
@@ -91,9 +94,31 @@ To add support for additional web services or features, simply extend from the `
## In the Wild ##
-Xignite Ruby was originally written and maintained for [GoldBug](http://goldbugapp.com) app. Issue a pull request or let us know if you'd like your site/company link added here.
+Xignite Ruby was originally written and maintained for the [GoldBug](http://goldb.ug) app. Issue a pull request or let us know if you'd like your site/company link added here.
## Disclaimer ##
The author of this software is not affiliated with Xignite and cannot provide support for Xignite products and services.
-Please read the [MIT LICENSE](https://github.com/heythisisnate/xignite/blob/master/LICENSE) before using this software.
+
+## License ##
+
+Copyright (c) 2011 Nate Clark, Irregular Expression LLC
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit ac64c36

Please sign in to comment.