Class: Wongi::Engine::WMEMatchData
- Inherits:
-
Object
- Object
- Wongi::Engine::WMEMatchData
- Defined in:
- lib/wongi-engine/wme_match_data.rb
Instance Attribute Summary collapse
-
#assignments ⇒ Object
readonly
Returns the value of attribute assignments.
Instance Method Summary collapse
- #&(other) ⇒ Object
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(assignments = { }, match = false) ⇒ WMEMatchData
constructor
A new instance of WMEMatchData.
- #match! ⇒ Object
- #match? ⇒ Boolean
Constructor Details
#initialize(assignments = { }, match = false) ⇒ WMEMatchData
Returns a new instance of WMEMatchData.
7 8 9 10 |
# File 'lib/wongi-engine/wme_match_data.rb', line 7 def initialize assignments = { }, match = false @assignments = assignments @match = match end |
Instance Attribute Details
#assignments ⇒ Object (readonly)
Returns the value of attribute assignments.
5 6 7 |
# File 'lib/wongi-engine/wme_match_data.rb', line 5 def assignments @assignments end |
Instance Method Details
#&(other) ⇒ Object
28 29 30 |
# File 'lib/wongi-engine/wme_match_data.rb', line 28 def & other WMEMatchData.new( assignments.merge( other.assignments ), match? && other.match? ) end |
#[](key) ⇒ Object
12 13 14 |
# File 'lib/wongi-engine/wme_match_data.rb', line 12 def [] key assignments[key] end |
#[]=(key, value) ⇒ Object
16 17 18 |
# File 'lib/wongi-engine/wme_match_data.rb', line 16 def []= key, value assignments[key] = value end |
#match! ⇒ Object
24 25 26 |
# File 'lib/wongi-engine/wme_match_data.rb', line 24 def match! @match = true end |
#match? ⇒ Boolean
20 21 22 |
# File 'lib/wongi-engine/wme_match_data.rb', line 20 def match? @match end |