Class: Hokusai::Ast::Func
- Inherits:
-
Object
- Object
- Hokusai::Ast::Func
- Defined in:
- ui/src/hokusai/ast.rb
Overview
A node representing a function call
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#args ⇒ Array(String)
Args of the func eg @target=“run_this(one, two)” the args are [one, two].
-
#initialize(raw) ⇒ Func
constructor
A new instance of Func.
-
#method ⇒ String
Name of the func eg @target=“run_this(one,two)” the name is ‘run_this`.
Constructor Details
#initialize(raw) ⇒ Func
Returns a new instance of Func.
47 48 49 |
# File 'ui/src/hokusai/ast.rb', line 47 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
45 46 47 |
# File 'ui/src/hokusai/ast.rb', line 45 def raw @raw end |
Instance Method Details
#args ⇒ Array(String)
Args of the func eg @target=“run_this(one, two)” the args are [one, two]
65 66 67 68 69 |
# File 'ui/src/hokusai/ast.rb', line 65 def args @strargs ||= raw[:strargs] .read_array_of_type(:pointer, :read_pointer, raw[:args_len]) .map(&:read_string).freeze end |
#method ⇒ String
Name of the func eg @target=“run_this(one,two)” the name is ‘run_this`
56 57 58 |
# File 'ui/src/hokusai/ast.rb', line 56 def method @method ||= raw[:function].freeze end |