Class: Burst::Configuration
- Inherits:
-
Object
- Object
- Burst::Configuration
- Defined in:
- lib/burst/configuration.rb
Instance Attribute Summary collapse
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 |
# File 'lib/burst/configuration.rb', line 11 def initialize(hash = {}) self.concurrency = hash.fetch(:concurrency, 5) end |
Instance Attribute Details
#concurrency ⇒ Object
Returns the value of attribute concurrency.
5 6 7 |
# File 'lib/burst/configuration.rb', line 5 def concurrency @concurrency end |
Class Method Details
.from_json(json) ⇒ Object
7 8 9 |
# File 'lib/burst/configuration.rb', line 7 def self.from_json(json) new(Burst::JSON.decode(json, symbolize_keys: true)) end |
Instance Method Details
#to_hash ⇒ Object
15 16 17 18 19 |
# File 'lib/burst/configuration.rb', line 15 def to_hash { concurrency: concurrency } end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/burst/configuration.rb', line 21 def to_json Burst::JSON.encode(to_hash) end |