Class: Cukedep::FileAction
- Inherits:
-
Object
- Object
- Cukedep::FileAction
- Defined in:
- lib/cukedep/file-action.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
-
#patterns ⇒ Object
Returns the value of attribute patterns.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Datavalue semantic: FileActions don't have identity.
-
#initialize(thePatterns, aDelta = nil) ⇒ FileAction
constructor
Constructor.
Constructor Details
#initialize(thePatterns, aDelta = nil) ⇒ FileAction
Constructor. [thePatterns] An array of file patterns.
13 14 15 16 |
# File 'lib/cukedep/file-action.rb', line 13 def initialize(thePatterns, aDelta = nil) @patterns = validate_file_patterns(thePatterns) @delta = validate_delta(aDelta) end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
9 10 11 |
# File 'lib/cukedep/file-action.rb', line 9 def delta @delta end |
#patterns ⇒ Object
Returns the value of attribute patterns.
8 9 10 |
# File 'lib/cukedep/file-action.rb', line 8 def patterns @patterns end |
Instance Method Details
#==(other) ⇒ Object
Datavalue semantic: FileActions don't have identity
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cukedep/file-action.rb', line 19 def ==(other) return true if object_id == other.object_id return false if self.class != other.class attrs = %I[patterns delta] equality = true attrs.each do |accessor| equality = send(accessor) == other.send(accessor) break unless equality end return equality end |