alch 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +51 -0
- data/lib/alch.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fb60e6e423677cd1c0488e22874d87cc542b8dd
|
4
|
+
data.tar.gz: 0cdc2a36fc4e601a49066dc2978af99862f5aa5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5b84d51c8348384ba2ddea3cd34e797b6cf413cb519e7237083d8efecf5a8de2de42f894c75a64196ef2d1cdc74e3001695d958f4e78ade1735108898e71d5c
|
7
|
+
data.tar.gz: c265351ae3da28092cc72d2c427c768f96f230ec0fcfaafab5b895fac587e432bbeb9e84935767575bf010bc46c4ea2c38846a7f19b9439a0495f8fe2b019db6
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Alch.rb
|
2
|
+
A very simplistic Runescape Alchemy API that can help you get alch prices of certain items. It's written in Ruby so that it can also be easily accessable within Rails.
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
You can download the newest version of Alch.rb through Git. Just enter the following in your command line:
|
6
|
+
|
7
|
+
`$ gem install alch`
|
8
|
+
|
9
|
+
That's it! You are now able to include the API into your projects.
|
10
|
+
|
11
|
+
To do so, include the src files in your project and when you'd like to use this API in a Class, just require the `alch.rb` file like so:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'alch'
|
15
|
+
```
|
16
|
+
|
17
|
+
### Dependencies
|
18
|
+
Since this was written in Ruby, you will need Ruby to use this API.
|
19
|
+
|
20
|
+
## Usage Examples
|
21
|
+
A very basic use case:
|
22
|
+
```ruby
|
23
|
+
require 'alch'
|
24
|
+
|
25
|
+
# Create ruby and nature rune items
|
26
|
+
item = new Item(1603)
|
27
|
+
nature_rune = new Item(Runes::NATURE_RUNE_ID)
|
28
|
+
|
29
|
+
# output => 'Profit from alching Ruby: -692'
|
30
|
+
print "Profit from alching #{item.name}: "
|
31
|
+
puts item.high_alch - (item.price + nature_rune.price)
|
32
|
+
```
|
33
|
+
|
34
|
+
Alternatively, you can also get the Item's ID by the Item's name.
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'alch'
|
38
|
+
|
39
|
+
# Create ruby and nature rune items
|
40
|
+
item = new Item(Item.id_by_name('ruby'))
|
41
|
+
nature_rune = new Item(Runes::NATURE_RUNE_ID)
|
42
|
+
|
43
|
+
# output => 'Profit from alching Ruby: -692'
|
44
|
+
print "Profit from alching #{item.name}: "
|
45
|
+
puts item.high_alch - (item.price + nature_rune.price)
|
46
|
+
```
|
47
|
+
|
48
|
+
# Full Documentation
|
49
|
+
## Classes
|
50
|
+
* **[Item.rb](https://github.com/RubySometimes/alchrb/blob/master/docs/classes/Item.md)**
|
51
|
+
|
data/lib/alch.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcello A. Sabino
|
@@ -16,6 +16,7 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- README.md
|
19
20
|
- lib/alch.rb
|
20
21
|
- lib/alch/item.rb
|
21
22
|
- lib/alch/osrs.rb
|