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
-
#attribute(name, options = {}) ⇒ void
Defines an attribute for the extended class.
-
#root_attribute(name, options = {}) ⇒ void
Defines a root attribute for the extended class.
-
#store_attribute(name, options) ⇒ void
private
Creates an attribute with the given name and options and stores it in the attributes hash.
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.
47 48 49 |
# File 'lib/cocoapods-core/specification/dsl/attribute_support.rb', line 47 def attribute(name, = {}) store_attribute(name, ) 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 multi-platform, they don't have inheritance, and they never have a default value.
28 29 30 31 32 |
# File 'lib/cocoapods-core/specification/dsl/attribute_support.rb', line 28 def root_attribute(name, = {}) [:root_only] = true [:multi_platform] = false store_attribute(name, ) end |
#store_attribute(name, options) ⇒ void (private)
This method returns an undefined value.
Creates an attribute with the given name and options and stores it in the Pod::Specification::DSL.attributes hash.
66 67 68 69 70 |
# File 'lib/cocoapods-core/specification/dsl/attribute_support.rb', line 66 def store_attribute(name, ) attr = Attribute.new(name, ) @attributes ||= {} @attributes[name] = attr end |