Class: Cocoadex::Method
- Inherits:
-
NestedNodeElement
- Object
- Element
- NestedNodeElement
- Cocoadex::Method
- 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
-
#abstract ⇒ Object
readonly
Returns the value of attribute abstract.
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#declaration ⇒ Object
readonly
Returns the value of attribute declaration.
-
#declared_in ⇒ Object
readonly
Returns the value of attribute declared_in.
-
#discussion ⇒ Object
readonly
Returns the value of attribute discussion.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#return_value ⇒ Object
readonly
Returns the value of attribute return_value.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(parent_class, type, node) ⇒ Method
constructor
A new instance of Method.
- #origin ⇒ Object
- #type ⇒ Object
Methods inherited from NestedNodeElement
Methods inherited from Element
#<=>, #parse_parameters, #print, #to_s
Methods included from Bri::Templates::Helpers
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
#abstract ⇒ Object (readonly)
Returns the value of attribute abstract.
7 8 9 |
# File 'lib/cocoadex/models/method.rb', line 7 def abstract @abstract end |
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
7 8 9 |
# File 'lib/cocoadex/models/method.rb', line 7 def availability @availability end |
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
7 8 9 |
# File 'lib/cocoadex/models/method.rb', line 7 def declaration @declaration end |
#declared_in ⇒ Object (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 |
#discussion ⇒ Object (readonly)
Returns the value of attribute discussion.
7 8 9 |
# File 'lib/cocoadex/models/method.rb', line 7 def discussion @discussion end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
7 8 9 |
# File 'lib/cocoadex/models/method.rb', line 7 def parameters @parameters end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/cocoadex/models/method.rb', line 7 def parent @parent end |
#return_value ⇒ Object (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 |
#scope ⇒ Object (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
#origin ⇒ Object
28 29 30 |
# File 'lib/cocoadex/models/method.rb', line 28 def origin parent.to_s end |
#type ⇒ Object
24 25 26 |
# File 'lib/cocoadex/models/method.rb', line 24 def type "#{scope.to_s.capitalize} Method" end |