Class: Inject::Rule
- Inherits:
-
Object
- Object
- Inject::Rule
- Defined in:
- lib/inject/rule.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(key, identifier, value, **options) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(key, identifier, value, **options) ⇒ Rule
Returns a new instance of Rule.
4 5 6 7 8 9 |
# File 'lib/inject/rule.rb', line 4 def initialize(key, identifier, value, **) @key = key @identifier = identifier @value = value = end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
2 3 4 |
# File 'lib/inject/rule.rb', line 2 def identifier @identifier end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
2 3 4 |
# File 'lib/inject/rule.rb', line 2 def key @key end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/inject/rule.rb', line 2 def end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
2 3 4 |
# File 'lib/inject/rule.rb', line 2 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/inject/rule.rb', line 11 def <=>(other) # this one has before: :all or before: other [other.identifier, :all].include?(self.[:before]) || # other one has after: :all, or after: self [self.identifier, :all].include?(other.[:after]) end |