Class: TargetScope

Inherits:
Object
  • Object
show all
Defined in:
lib/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TargetScope

Returns a new instance of TargetScope.



75
76
77
# File 'lib/dsl.rb', line 75

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



73
74
75
# File 'lib/dsl.rb', line 73

def name
  @name
end

Instance Method Details

#capability(capability_name) ⇒ Object



92
93
94
95
# File 'lib/dsl.rb', line 92

def capability(capability_name)
  target_name = @name
  Ambient.configure { set_capability(target_name, capability_name) }
end

#configure(&block) ⇒ Object



79
80
81
# File 'lib/dsl.rb', line 79

def configure(&block)
  instance_eval(&block)
end

#development_team(team_name) ⇒ Object



97
98
99
100
# File 'lib/dsl.rb', line 97

def development_team(team_name)
  target_name = @name
  Ambient.configure { set_development_team(target_name, team_name) }
end

#option(option_name, value) ⇒ Object



83
84
85
86
# File 'lib/dsl.rb', line 83

def option(option_name, value)
  target_name = @name
  Ambient.configure { set_option(option_name, value, target: target_name) }
end

#scheme(name, parent: nil, &block) ⇒ Object



88
89
90
# File 'lib/dsl.rb', line 88

def scheme(name, parent: nil, &block)
  SchemeScope.new(self, name, parent).configure(&block)
end