Class: XDry::OMethod

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selector) ⇒ OMethod

Returns a new instance of OMethod.



235
236
237
# File 'lib/xdry/parsing/model.rb', line 235

def initialize selector
  @selector = selector
end

Instance Attribute Details

#headerObject (readonly)

Returns the value of attribute header.



233
234
235
# File 'lib/xdry/parsing/model.rb', line 233

def header
  @header
end

#implObject (readonly)

Returns the value of attribute impl.



233
234
235
# File 'lib/xdry/parsing/model.rb', line 233

def impl
  @impl
end

#selectorObject (readonly)

Returns the value of attribute selector.



233
234
235
# File 'lib/xdry/parsing/model.rb', line 233

def selector
  @selector
end

Instance Method Details

#<<(child) ⇒ Object



259
260
# File 'lib/xdry/parsing/model.rb', line 259

def << child
end

#add_method_header!(method_header) ⇒ Object



239
240
241
# File 'lib/xdry/parsing/model.rb', line 239

def add_method_header! method_header
  @header = method_header
end

#add_method_impl!(method_impl) ⇒ Object



243
244
245
# File 'lib/xdry/parsing/model.rb', line 243

def add_method_impl! method_impl
  @impl = method_impl.bind(self)
end

#has_header?Boolean

Returns:

  • (Boolean)


247
248
249
# File 'lib/xdry/parsing/model.rb', line 247

def has_header?
  not @header.nil?
end

#has_impl?Boolean

Returns:

  • (Boolean)


251
252
253
# File 'lib/xdry/parsing/model.rb', line 251

def has_impl?
  not @impl.nil?
end

#header_or_implObject



266
267
268
# File 'lib/xdry/parsing/model.rb', line 266

def header_or_impl
  @header || @impl.start_node
end

#ret_typeObject



255
256
257
# File 'lib/xdry/parsing/model.rb', line 255

def ret_type
  header_or_impl.ret_type
end

#to_sObject



262
263
264
# File 'lib/xdry/parsing/model.rb', line 262

def to_s
  header_or_impl.to_s
end