Class: Pod::Bazel::Target::RuleArgs

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/bazel/target.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ RuleArgs

Returns a new instance of RuleArgs.

Yields:

  • (_self)

Yield Parameters:



13
14
15
16
17
# File 'lib/cocoapods/bazel/target.rb', line 13

def initialize
  @kwargs = {}

  yield self if block_given?
end

Instance Attribute Details

#kwargsObject (readonly)

Returns the value of attribute kwargs.



11
12
13
# File 'lib/cocoapods/bazel/target.rb', line 11

def kwargs
  @kwargs
end

Instance Method Details

#add(name, value, defaults: nil) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/cocoapods/bazel/target.rb', line 19

def add(name, value, defaults: nil)
  return self if defaults&.include?(value)

  raise 'Duplicate' if kwargs.key?(name)

  kwargs[name] = value

  self
end