Class: Hokusai::Ast::Event

Inherits:
Object
  • Object
show all
Defined in:
ui/src/hokusai/ast.rb

Overview

A node representing an ast event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Event

Returns a new instance of Event.



77
78
79
# File 'ui/src/hokusai/ast.rb', line 77

def initialize(raw)
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



75
76
77
# File 'ui/src/hokusai/ast.rb', line 75

def raw
  @raw
end

Instance Method Details

#nameString

Returns:

  • (String)


82
83
84
# File 'ui/src/hokusai/ast.rb', line 82

def name
  @name ||= @raw[:name].freeze
end

#valueFunc?

Returns:



87
88
89
90
91
92
93
# File 'ui/src/hokusai/ast.rb', line 87

def value
  @call ||= raw[:call]

  return nil if @call.null?

  @func ||= Func.new(@call)
end