Class: Spectro::Spec
- Inherits:
-
Object
- Object
- Spectro::Spec
- Defined in:
- lib/spectro/spec.rb,
lib/spectro/spec/rule.rb,
lib/spectro/spec/parser.rb,
lib/spectro/spec/signature.rb
Defined Under Namespace
Classes: Parser, Rule, Signature
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#md5 ⇒ Object
Returns the value of attribute md5.
-
#rules ⇒ Object
Returns the value of attribute rules.
-
#signature ⇒ Object
Returns the value of attribute signature.
Instance Method Summary collapse
- #==(spec) ⇒ Object
-
#initialize(md5, signature, description, rules) ⇒ Spec
constructor
A new instance of Spec.
- #to_hash ⇒ Object
Constructor Details
#initialize(md5, signature, description, rules) ⇒ Spec
Returns a new instance of Spec.
15 16 17 18 19 20 |
# File 'lib/spectro/spec.rb', line 15 def initialize md5, signature, description, rules self.description = description self.md5 = md5 self.rules = rules self.signature = signature end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/spectro/spec.rb', line 9 def description @description end |
#md5 ⇒ Object
Returns the value of attribute md5.
9 10 11 |
# File 'lib/spectro/spec.rb', line 9 def md5 @md5 end |
#rules ⇒ Object
Returns the value of attribute rules.
9 10 11 |
# File 'lib/spectro/spec.rb', line 9 def rules @rules end |
#signature ⇒ Object
Returns the value of attribute signature.
9 10 11 |
# File 'lib/spectro/spec.rb', line 9 def signature @signature end |
Instance Method Details
#==(spec) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/spectro/spec.rb', line 22 def == spec return \ self.description == spec.description && \ self.signature == spec.signature && \ self.rules == spec.rules end |
#to_hash ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/spectro/spec.rb', line 29 def to_hash return { md5: self.md5, description: self.description, rules: self.rules.collect(&:to_hash), signature: self.signature.to_hash } end |