Class: CC::Config::Prepare
- Inherits:
-
Object
- Object
- CC::Config::Prepare
- Defined in:
- lib/cc/config/prepare.rb
Defined Under Namespace
Classes: Fetch
Instance Attribute Summary collapse
-
#fetch ⇒ Object
readonly
Returns the value of attribute fetch.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(fetch: Fetch.new) ⇒ Prepare
constructor
A new instance of Prepare.
- #merge(other) ⇒ Object
Constructor Details
#initialize(fetch: Fetch.new) ⇒ Prepare
Returns a new instance of Prepare.
16 17 18 |
# File 'lib/cc/config/prepare.rb', line 16 def initialize(fetch: Fetch.new) @fetch = fetch end |
Instance Attribute Details
#fetch ⇒ Object (readonly)
Returns the value of attribute fetch.
4 5 6 |
# File 'lib/cc/config/prepare.rb', line 4 def fetch @fetch end |
Class Method Details
.from_data(data) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/cc/config/prepare.rb', line 6 def self.from_data(data) if data.present? fetch = Fetch.from_data(data.fetch("fetch", [])) new(fetch: fetch) else new end end |
Instance Method Details
#merge(other) ⇒ Object
20 21 22 |
# File 'lib/cc/config/prepare.rb', line 20 def merge(other) Prepare.new(fetch: fetch.merge(other.fetch)) end |