Class: XDry::NMethodHeader

Inherits:
Node
  • Object
show all
Defined in:
lib/xdry/parsing/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#indent, #pos

Instance Method Summary collapse

Methods inherited from Node

#method_missing, #tagged_with?, #tags, #tags=, #tags_comment

Constructor Details

#initialize(selector_def, ret_type) ⇒ NMethodHeader

Returns a new instance of NMethodHeader.



100
101
102
# File 'lib/xdry/parsing/nodes.rb', line 100

def initialize selector_def, ret_type
  @selector_def, @ret_type = selector_def, ret_type
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class XDry::Node

Instance Attribute Details

#ret_typeObject (readonly)

Returns the value of attribute ret_type.



98
99
100
# File 'lib/xdry/parsing/nodes.rb', line 98

def ret_type
  @ret_type
end

#selector_defObject (readonly)

Returns the value of attribute selector_def.



98
99
100
# File 'lib/xdry/parsing/nodes.rb', line 98

def selector_def
  @selector_def
end

Instance Method Details

#selectorObject



104
105
106
# File 'lib/xdry/parsing/nodes.rb', line 104

def selector
  @selector_def.selector
end

#to_sObject



108
109
110
# File 'lib/xdry/parsing/nodes.rb', line 108

def to_s
  "- (#{@ret_type})#{selector_def}"
end