Class: Spec

Inherits:
Object
  • Object
show all
Defined in:
app/models/sysops/spec.rb

Overview

Specification for a Package (project)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Spec

Returns a new instance of Spec.



6
7
8
9
# File 'app/models/sysops/spec.rb', line 6

def initialize(parent)
  @environment = Kaigara::Environment.new
  @parent = parent
end

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



5
6
7
# File 'app/models/sysops/spec.rb', line 5

def environment
  @environment
end

Instance Method Details

#dep(name, version: nil, source: nil) ⇒ Object



19
20
21
22
23
24
25
# File 'app/models/sysops/spec.rb', line 19

def dep(name, version: nil, source: nil)
  @parent.dependencies ||= {}
  @parent.dependencies[name] = {
    version: version,
    source: source
  }
end

#name(value) ⇒ Object



11
12
13
# File 'app/models/sysops/spec.rb', line 11

def name(value)
  @parent.name = value
end

#version(value) ⇒ Object



15
16
17
# File 'app/models/sysops/spec.rb', line 15

def version(value)
  @parent.version = value
end