Module: ConcurrentPipeline::Model

Included in:
Pipeline::PipelineStep
Defined in:
lib/concurrent_pipeline/model.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



13
14
15
# File 'lib/concurrent_pipeline/model.rb', line 13

def self.extended(base)
  base.include(InstanceMethods)
end

Instance Method Details

#attribute(name, **opts) ⇒ Object



25
26
27
28
29
# File 'lib/concurrent_pipeline/model.rb', line 25

def attribute(name, **opts)
  attributes[name] = opts

  define_method(name) { attributes[name] }
end

#attributesObject



21
22
23
# File 'lib/concurrent_pipeline/model.rb', line 21

def attributes
  @attributes ||= {}
end

#inherited(base) ⇒ Object



17
18
19
# File 'lib/concurrent_pipeline/model.rb', line 17

def inherited(base)
  base.instance_variable_set(:@attributes, attributes.dup)
end