Class: UState::Query::Not

Inherits:
Node
  • Object
show all
Defined in:
lib/ustate/query/not.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#indent, #inspect_helper

Constructor Details

#initialize(a) ⇒ Not

Returns a new instance of Not.



4
5
6
# File 'lib/ustate/query/not.rb', line 4

def initialize(a)
  @a = a
end

Instance Attribute Details

#aObject (readonly)

Returns the value of attribute a.



3
4
5
# File 'lib/ustate/query/not.rb', line 3

def a
  @a
end

Instance Method Details

#==(o) ⇒ Object



8
9
10
# File 'lib/ustate/query/not.rb', line 8

def ==(o)
  o.kind_of? Not and @a == o.a
end

#===(state) ⇒ Object



12
13
14
# File 'lib/ustate/query/not.rb', line 12

def ===(state)
  not @a === state
end

#childrenObject



16
17
18
# File 'lib/ustate/query/not.rb', line 16

def children
  [@a]
end

#children=(c) ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
# File 'lib/ustate/query/not.rb', line 20

def children=(c)
  raise ArgumentError unless c.size == 1
end

#inspectObject



24
25
26
# File 'lib/ustate/query/not.rb', line 24

def inspect
  inspect_helper @a
end

#massObject



28
29
30
# File 'lib/ustate/query/not.rb', line 28

def mass
  1 + @a.mass
end