Class: Interfacets::Test::Js::Receivers::React

Inherits:
Object
  • Object
show all
Defined in:
lib/interfacets/test/js/receivers/react.rb,
lib/interfacets/test/js/receivers/react/node.rb,
lib/interfacets/test/js/receivers/react/node/xml_parser.rb

Defined Under Namespace

Classes: Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, validation_engine: nil) ⇒ React

Returns a new instance of React.



12
13
14
15
16
# File 'lib/interfacets/test/js/receivers/react.rb', line 12

def initialize(name:, validation_engine: nil)
  @name = name
  @validation_engine = validation_engine
  @actions = {}
end

Instance Attribute Details

#name ⇒ Object (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/interfacets/test/js/receivers/react.rb', line 11

def name
  @name
end

#node ⇒ Object (readonly)

Returns the value of attribute node.



11
12
13
# File 'lib/interfacets/test/js/receivers/react.rb', line 11

def node
  @node
end

#validation_engine ⇒ Object (readonly)

Returns the value of attribute validation_engine.



11
12
13
# File 'lib/interfacets/test/js/receivers/react.rb', line 11

def validation_engine
  @validation_engine
end

Instance Method Details

#handler ⇒ Object



25
26
27
# File 'lib/interfacets/test/js/receivers/react.rb', line 25

def handler
  @node
end

#receive(payload:, dispatch:) ⇒ Object



18
19
20
21
22
23
# File 'lib/interfacets/test/js/receivers/react.rb', line 18

def receive(payload:, dispatch:)
  @dispatch = dispatch
  @actions = nil
  @node&.stale!
  @node = Node.parse(json: payload, dispatch:, validation_engine:)
end