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.



169
170
171
# File 'lib/dsl.rb', line 169

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



167
168
169
# File 'lib/dsl.rb', line 167

def name
  @name
end

Instance Method Details

#capability(capability_name) ⇒ Object



186
187
188
189
# File 'lib/dsl.rb', line 186

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

#configure(&block) ⇒ Object



173
174
175
# File 'lib/dsl.rb', line 173

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

#development_team(team_name) ⇒ Object



191
192
193
194
# File 'lib/dsl.rb', line 191

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

#option(option_name, value) ⇒ Object



177
178
179
180
# File 'lib/dsl.rb', line 177

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



182
183
184
# File 'lib/dsl.rb', line 182

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