Unverified Commit e57559d7 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7489 from dnkoutso/immutability_wins

Make PodVariant and PodVariantSet immutable
parents ec2073bf 340549bc
...@@ -5,19 +5,19 @@ module Pod ...@@ -5,19 +5,19 @@ module Pod
class PodVariant class PodVariant
# @return [Array<Specification>] the spec and subspecs for the target # @return [Array<Specification>] the spec and subspecs for the target
# #
attr_accessor :specs attr_reader :specs
# @return [Array<Specification>] the test specs for the target # @return [Array<Specification>] the test specs for the target
# #
attr_accessor :test_specs attr_reader :test_specs
# @return [Platform] the platform # @return [Platform] the platform
# #
attr_accessor :platform attr_reader :platform
# @return [Bool] whether this pod should be built as framework # @return [Bool] whether this pod should be built as framework
# #
attr_accessor :requires_frameworks attr_reader :requires_frameworks
alias_method :requires_frameworks?, :requires_frameworks alias_method :requires_frameworks?, :requires_frameworks
# @return [Specification] the root specification # @return [Specification] the root specification
...@@ -34,10 +34,10 @@ module Pod ...@@ -34,10 +34,10 @@ module Pod
# @param [Bool] requires_frameworks @see #requires_frameworks? # @param [Bool] requires_frameworks @see #requires_frameworks?
# #
def initialize(specs, test_specs, platform, requires_frameworks = false) def initialize(specs, test_specs, platform, requires_frameworks = false)
self.specs = specs @specs = specs
self.test_specs = test_specs @test_specs = test_specs
self.platform = platform @platform = platform
self.requires_frameworks = requires_frameworks @requires_frameworks = requires_frameworks
end end
# @note Test specs are intentionally not included as part of the equality for pod variants since a # @note Test specs are intentionally not included as part of the equality for pod variants since a
......
...@@ -5,16 +5,16 @@ module Pod ...@@ -5,16 +5,16 @@ module Pod
class Analyzer class Analyzer
# Collects all {PodVariant}. # Collects all {PodVariant}.
class PodVariantSet class PodVariantSet
# @return [Array<PodVariant>] the different variants. # @return [Array<PodVariant>] the different variants within this set.
# #
attr_accessor :variants attr_reader :variants
# Initialize a new instance. # Initialize a new instance.
# #
# @param [Array<PodVariant>] variants @see #variants # @param [Array<PodVariant>] variants @see #variants
# #
def initialize(variants) def initialize(variants)
self.variants = variants @variants = variants
end end
# Describes what makes each {PodVariant} distinct among the others. # Describes what makes each {PodVariant} distinct among the others.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment