Module: Kojn
- Defined in:
- lib/kojn.rb,
lib/kojn/ipn.rb,
lib/kojn/net.rb,
lib/kojn/model.rb,
lib/kojn/crypto.rb,
lib/kojn/invoice.rb,
lib/kojn/net_old.rb,
lib/kojn/version.rb,
lib/kojn/collection.rb,
lib/kojn/transaction.rb
Defined Under Namespace
Modules: Net
Classes: AuthenticityException, Collection, Crypto, Invoice, Invoices, Ipn, MissingConfigExecption, Model, Transactions, Tx
Constant Summary
collapse
- VERSION =
"0.0.2"
- @@ipn_sec =
:integrity
- @@host =
"kojn.nl"
- @@port =
80
- @@ssl =
true
Class Method Summary
collapse
Class Method Details
.[](key) ⇒ Object
70
71
72
|
# File 'lib/kojn.rb', line 70
def self.[](key)
self.send(key)
end
|
.[]=(key, value) ⇒ Object
74
75
76
|
# File 'lib/kojn.rb', line 74
def self.[]=(key, value)
self.send("#{key}=", value)
end
|
.crypto ⇒ Object
47
48
49
50
51
52
53
|
# File 'lib/kojn.rb', line 47
def self.crypto
raise MissingConfigExecption.new("API key not set") unless self.api_key
@@crypto ||= Kojn::Crypto.new
return @@crypto
end
|
.invoices ⇒ Object
55
56
57
58
59
60
61
|
# File 'lib/kojn.rb', line 55
def self.invoices
raise MissingConfigExecption.new("API key not set") unless self.api_key
@@transacions ||= Kojn::Invoices.new
return @@transacions
end
|
.ipn(params) ⇒ Object
63
64
65
66
67
|
# File 'lib/kojn.rb', line 63
def self.ipn(params)
raise MissingConfigExecption.new("API key not set") unless self.api_key
return Kojn::Ipn.new(params)
end
|
.parse_object!(object, klass) ⇒ Object
9
10
11
12
13
|
# File 'lib/kojn/transaction.rb', line 9
def self.parse_object!(object, klass)
object = JSON.parse(object) if object.is_a? String
klass.new(object)
end
|
.parse_objects!(string, klass) ⇒ Object
2
3
4
5
6
7
|
# File 'lib/kojn/transaction.rb', line 2
def self.parse_objects!(string, klass)
objects = JSON.parse(string)
objects.collect do |t_json|
Kojn.parse_object!(t_json, klass)
end
end
|
.setup {|_self| ... } ⇒ Object
78
79
80
|
# File 'lib/kojn.rb', line 78
def self.setup
yield self
end
|