Module: Pod::Specification::DSL::AttributeSupport

Included in:
Pod::Specification::DSL
Defined in:
lib/cocoapods-core/specification/dsl/attribute_support.rb

Overview

This module provides support for storing the runtime information of the Pod::Specification DSL.

Instance Method Summary collapse

Instance Method Details

#attribute(name, options = {}) ⇒ void

This method returns an undefined value.

Defines an attribute for the extended class.

Regular attributes in general support inheritance and multi platform values, so resolving them for a given specification is not trivial.

Parameters:

  • name (String)

    The name of the attribute.

  • options (Hash) (defaults to: {})

    The options used to initialize the attribute.



49
50
51
# File 'lib/cocoapods-core/specification/dsl/attribute_support.rb', line 49

def attribute(name, options = {})
  store_attribute(name, options)
end

#root_attribute(name, options = {}) ⇒ void

This method returns an undefined value.

Defines a root attribute for the extended class.

Root attributes make sense only in root specification, they never are multiplatform, they don’t have inheritance, and they never have a default value.

Parameters:

  • name (String)

    The name of the attribute.

  • options (Hash) (defaults to: {})

    The options used to initialize the attribute.



30
31
32
33
34
# File 'lib/cocoapods-core/specification/dsl/attribute_support.rb', line 30

def root_attribute(name, options = {})
  options[:root_only] = true
  options[:multi_platform] = false
  store_attribute(name, options)
end