Class: Richcss::TestSpecification
- Inherits:
-
Object
- Object
- Richcss::TestSpecification
- Defined in:
- lib/richcss/richcss_test_specification.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#name ⇒ Object
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(hash) ⇒ TestSpecification
constructor
A new instance of TestSpecification.
- #to_s ⇒ Object
Constructor Details
#initialize(hash) ⇒ TestSpecification
Returns a new instance of TestSpecification.
4 5 6 7 8 9 10 |
# File 'lib/richcss/richcss_test_specification.rb', line 4 def initialize(hash) self.name = hash['name'] self.version = VersionKit::Version.new(hash['version']) self.dependencies = hash['dependencies'].map do |(name, requirement)| VersionKit::Dependency.new(name, requirement.split(',').map(&:chomp)) end end |
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
3 4 5 |
# File 'lib/richcss/richcss_test_specification.rb', line 3 def dependencies @dependencies end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/richcss/richcss_test_specification.rb', line 3 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/richcss/richcss_test_specification.rb', line 3 def version @version end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 15 16 |
# File 'lib/richcss/richcss_test_specification.rb', line 12 def ==(other) name == other.name && version == other.version && dependencies == other.dependencies end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/richcss/richcss_test_specification.rb', line 18 def to_s "#{name} (#{version})" end |