Class: Cocoadex::Method

Inherits:
NestedNodeElement show all
Defined in:
lib/cocoadex/models/method.rb

Overview

A model of a method in a Cocoa class

Constant Summary collapse

TEMPLATE_NAME =
:method

Instance Attribute Summary collapse

Attributes inherited from Element

#name

Instance Method Summary collapse

Methods inherited from NestedNodeElement

#parse_properties

Methods inherited from Element

#<=>, #parse_parameters, #print, #to_s

Methods included from Bri::Templates::Helpers

h3, inline_title, wrap

Constructor Details

#initialize(parent_class, type, node) ⇒ Method

Returns a new instance of Method.



15
16
17
18
19
20
21
22
# File 'lib/cocoadex/models/method.rb', line 15

def initialize parent_class, type, node
  @parent = parent_class
  @scope  = type
  @name   = node.css("h3.#{type}Method").first.text

  parse_properties(node)
  parse_parameters(node.css(".parameters").first)
end

Instance Attribute Details

#abstractObject (readonly)

Returns the value of attribute abstract.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def abstract
  @abstract
end

#availabilityObject (readonly)

Returns the value of attribute availability.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def availability
  @availability
end

#declarationObject (readonly)

Returns the value of attribute declaration.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def declaration
  @declaration
end

#declared_inObject (readonly)

Returns the value of attribute declared_in.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def declared_in
  @declared_in
end

#discussionObject (readonly)

Returns the value of attribute discussion.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def discussion
  @discussion
end

#parametersObject (readonly)

Returns the value of attribute parameters.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def parameters
  @parameters
end

#parentObject (readonly)

Returns the value of attribute parent.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def parent
  @parent
end

#return_valueObject (readonly)

Returns the value of attribute return_value.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def return_value
  @return_value
end

#scopeObject (readonly)

Returns the value of attribute scope.



7
8
9
# File 'lib/cocoadex/models/method.rb', line 7

def scope
  @scope
end

Instance Method Details

#originObject



28
29
30
# File 'lib/cocoadex/models/method.rb', line 28

def origin
  parent.to_s
end

#typeObject



24
25
26
# File 'lib/cocoadex/models/method.rb', line 24

def type
  "#{scope.to_s.capitalize} Method"
end