Class: Silkroad::Batch
- Inherits:
- BasicObject
- Defined in:
- lib/silkroad/batch.rb
Instance Attribute Summary collapse
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Batch
constructor
A new instance of Batch.
- #rpc(meth, *params) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Batch
Returns a new instance of Batch.
5 6 7 8 |
# File 'lib/silkroad/batch.rb', line 5 def initialize(&block) @requests = [] instance_eval(&block) end |
Instance Attribute Details
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
3 4 5 |
# File 'lib/silkroad/batch.rb', line 3 def requests @requests end |
Instance Method Details
#rpc(meth, *params) ⇒ Object
10 11 12 |
# File 'lib/silkroad/batch.rb', line 10 def rpc(meth, *params) @requests << {method: meth, params: params} end |