Class: Xcake::Configuration::PreprocessorDefinitionsSettingProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/xcake/dsl/configuration/proxies/preproccessor_definitions_setting_proxy.rb

Overview

This class is a proxy to the Preprocessor build setting. It abstracts the setting of the value for this setting and makes it easier to define new preprocessor definitions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(settings, key) ⇒ PreprocessorDefinitionsSettingProxy

Returns a new instance of PreprocessorDefinitionsSettingProxy.

Parameters:

  • settings (Hash<String, Object>)

    the settings for the proxied configuration

  • key (String)

    the key for the settings where the preprocessor definitions are kept



29
30
31
32
33
# File 'lib/xcake/dsl/configuration/proxies/preproccessor_definitions_setting_proxy.rb', line 29

def initialize(settings, key)
  @settings = settings
  @key = key
  @settings[@key] ||= ['$(inherited)']
end

Instance Attribute Details

#keyString

Returns the key for the settings where the preprocessor definitions are kept.

Returns:

  • (String)

    the key for the settings where the preprocessor definitions are kept



20
21
22
# File 'lib/xcake/dsl/configuration/proxies/preproccessor_definitions_setting_proxy.rb', line 20

def key
  @key
end

#settingsHash<String, Object>

the settings for the configuration this proxy is for

Returns:

  • (Hash<String, Object>)

    the settings for the proxied configuration



15
16
17
# File 'lib/xcake/dsl/configuration/proxies/preproccessor_definitions_setting_proxy.rb', line 15

def settings
  @settings
end

Instance Method Details

#[]=(key, value) ⇒ Object

The subscript operator is used to define the preprocessor defination

Parameters:

  • key (String)

    the key for the preprocessor definition

  • value (Object)

    the value for the preprocessor definition



43
44
45
# File 'lib/xcake/dsl/configuration/proxies/preproccessor_definitions_setting_proxy.rb', line 43

def []=(key, value)
  @settings[@key] << "#{key}=#{value}"
end