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.
5 6 7 8 |
# File 'lib/wongi-engine/wme_match_data.rb', line 5 def initialize(assignments = {}, match = false) @assignments = assignments @match = match end |
Instance Attribute Details
#assignments ⇒ Object (readonly)
Returns the value of attribute assignments.
3 4 5 |
# File 'lib/wongi-engine/wme_match_data.rb', line 3 def assignments @assignments end |
Instance Method Details
#&(other) ⇒ Object
26 27 28 |
# File 'lib/wongi-engine/wme_match_data.rb', line 26 def &(other) WMEMatchData.new(assignments.merge(other.assignments), match? && other.match?) end |
#[](key) ⇒ Object
10 11 12 |
# File 'lib/wongi-engine/wme_match_data.rb', line 10 def [](key) assignments[key] end |
#[]=(key, value) ⇒ Object
14 15 16 |
# File 'lib/wongi-engine/wme_match_data.rb', line 14 def []=(key, value) assignments[key] = value end |
#match! ⇒ Object
22 23 24 |
# File 'lib/wongi-engine/wme_match_data.rb', line 22 def match! @match = true end |
#match? ⇒ Boolean
18 19 20 |
# File 'lib/wongi-engine/wme_match_data.rb', line 18 def match? @match end |