Class: Ruleby::Core::Template
- Inherits:
-
Object
- Object
- Ruleby::Core::Template
- Defined in:
- lib/core/atoms.rb
Overview
This class encapsulates the criteria the HeadAtom uses to match. The clazz attribute represents a Class type, and the mode defines whether the head will match only class that are exactly a particular type, or if it will match classes that inherit that type also.
Instance Attribute Summary collapse
-
#clazz ⇒ Object
readonly
Returns the value of attribute clazz.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #==(df) ⇒ Object
-
#initialize(clazz, mode = :equals) ⇒ Template
constructor
A new instance of Template.
Constructor Details
#initialize(clazz, mode = :equals) ⇒ Template
Returns a new instance of Template.
170 171 172 173 |
# File 'lib/core/atoms.rb', line 170 def initialize(clazz,mode=:equals) @clazz = clazz @mode = mode end |
Instance Attribute Details
#clazz ⇒ Object (readonly)
Returns the value of attribute clazz.
167 168 169 |
# File 'lib/core/atoms.rb', line 167 def clazz @clazz end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
168 169 170 |
# File 'lib/core/atoms.rb', line 168 def mode @mode end |
Instance Method Details
#==(df) ⇒ Object
175 176 177 |
# File 'lib/core/atoms.rb', line 175 def ==(df) Template === df && df.clazz == @clazz && df.mode == @mode end |