Module: Pod::Specification::YAMLSupport
- Included in:
- Pod::Specification
- Defined in:
- lib/cocoapods-core/specification/yaml.rb
Instance Method Summary collapse
-
#safe_to_hash? ⇒ Bool
Whether the specification can be converted to a hash without loss of information.
-
#to_hash ⇒ Hash
The hash representation of the specification including subspecs.
-
#to_yaml ⇒ String
The yaml representation of the specification.
Instance Method Details
#safe_to_hash? ⇒ Bool
Returns Whether the specification can be converted to a hash without loss of information.
23 24 25 |
# File 'lib/cocoapods-core/specification/yaml.rb', line 23 def safe_to_hash? pre_install_callback.nil? && post_install_callback.nil? end |
#to_hash ⇒ Hash
Returns the hash representation of the specification including subspecs.
14 15 16 17 18 |
# File 'lib/cocoapods-core/specification/yaml.rb', line 14 def to_hash hash = attributes_hash.dup hash["subspecs"] = subspecs.map { |spec| spec.to_hash } unless subspecs.empty? hash end |
#to_yaml ⇒ String
Returns the yaml representation of the specification.
7 8 9 |
# File 'lib/cocoapods-core/specification/yaml.rb', line 7 def to_yaml to_hash.to_yaml end |