Sha256: 26756591f34f950d0f49a74f2ff624bd6f54218c79d2b275f1fcb2a62bf0d619
Contents?: true
Size: 643 Bytes
Versions: 19
Compression:
Stored size: 643 Bytes
Contents
module Vpsb class BaseTask @prepare_squence = [] attr_reader :core, :prepare_squence def initialize(core) @core = core end def self.prepare_squence(*resource) (@prepare_squence ||= []).push(*resource) end def prepare_squence self.class.instance_variable_get(:@prepare_squence) end protected def prepare (prepare_squence || []).each{ |r| core.get(r) } end def reprepare (prepare_squence || []).each{ |r| core.get(r, force:true) } end def preparation_results (prepare_squence || []).inject({}){ |h, r| h[r] = core.get(r); h } end end end
Version data entries
19 entries across 19 versions & 1 rubygems