Class: Jazzy::SourceDeclaration

Inherits:
Object
  • Object
show all
Defined in:
lib/jazzy/source_declaration.rb,
lib/jazzy/source_declaration/type.rb,
lib/jazzy/source_declaration/access_control_level.rb

Defined Under Namespace

Classes: AccessControlLevel, Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#abstractObject

Returns the value of attribute abstract.



57
58
59
# File 'lib/jazzy/source_declaration.rb', line 57

def abstract
  @abstract
end

#access_control_levelObject

Returns the value of attribute access_control_level.



65
66
67
# File 'lib/jazzy/source_declaration.rb', line 65

def access_control_level
  @access_control_level
end

#childrenObject

counterpart of parent_in_docs



19
20
21
# File 'lib/jazzy/source_declaration.rb', line 19

def children
  @children
end

#columnObject

Returns the value of attribute column.



53
54
55
# File 'lib/jazzy/source_declaration.rb', line 53

def column
  @column
end

#declarationObject

Returns the value of attribute declaration.



56
57
58
# File 'lib/jazzy/source_declaration.rb', line 56

def declaration
  @declaration
end

#default_impl_abstractObject

Returns the value of attribute default_impl_abstract.



58
59
60
# File 'lib/jazzy/source_declaration.rb', line 58

def default_impl_abstract
  @default_impl_abstract
end

#discussionObject

Returns the value of attribute discussion.



60
61
62
# File 'lib/jazzy/source_declaration.rb', line 60

def discussion
  @discussion
end

#end_lineObject

Returns the value of attribute end_line.



67
68
69
# File 'lib/jazzy/source_declaration.rb', line 67

def end_line
  @end_line
end

#fileObject

Returns the value of attribute file.



51
52
53
# File 'lib/jazzy/source_declaration.rb', line 51

def file
  @file
end

#from_protocol_extensionObject

Returns the value of attribute from_protocol_extension.



59
60
61
# File 'lib/jazzy/source_declaration.rb', line 59

def from_protocol_extension
  @from_protocol_extension
end

#lineObject

Returns the value of attribute line.



52
53
54
# File 'lib/jazzy/source_declaration.rb', line 52

def line
  @line
end

#markObject

Returns the value of attribute mark.



64
65
66
# File 'lib/jazzy/source_declaration.rb', line 64

def mark
  @mark
end

#nameObject

Returns the value of attribute name.



55
56
57
# File 'lib/jazzy/source_declaration.rb', line 55

def name
  @name
end

Returns the value of attribute nav_order.



68
69
70
# File 'lib/jazzy/source_declaration.rb', line 68

def nav_order
  @nav_order
end

#parametersObject

Returns the value of attribute parameters.



62
63
64
# File 'lib/jazzy/source_declaration.rb', line 62

def parameters
  @parameters
end

#parent_in_codeObject

Element containing this declaration in the code



12
13
14
# File 'lib/jazzy/source_declaration.rb', line 12

def parent_in_code
  @parent_in_code
end

#parent_in_docsObject

Logical parent in the documentation. May differ from parent_in_code because of top-level categories and merged extensions.



16
17
18
# File 'lib/jazzy/source_declaration.rb', line 16

def parent_in_docs
  @parent_in_docs
end

#returnObject

Returns the value of attribute return.



61
62
63
# File 'lib/jazzy/source_declaration.rb', line 61

def return
  @return
end

#start_lineObject

Returns the value of attribute start_line.



66
67
68
# File 'lib/jazzy/source_declaration.rb', line 66

def start_line
  @start_line
end

#typeObject

kind of declaration (e.g. class, variable, function)



7
8
9
# File 'lib/jazzy/source_declaration.rb', line 7

def type
  @type
end

#typenameObject

static type of declared element (e.g. String.Type -> ())



9
10
11
# File 'lib/jazzy/source_declaration.rb', line 9

def typename
  @typename
end

#urlObject

Returns the value of attribute url.



63
64
65
# File 'lib/jazzy/source_declaration.rb', line 63

def url
  @url
end

#usrObject

Returns the value of attribute usr.



54
55
56
# File 'lib/jazzy/source_declaration.rb', line 54

def usr
  @usr
end

Instance Method Details

#fully_qualified_nameObject



40
41
42
# File 'lib/jazzy/source_declaration.rb', line 40

def fully_qualified_name
  namespace_path.map(&:name).join('.')
end

#namespace_ancestorsObject



32
33
34
35
36
37
38
# File 'lib/jazzy/source_declaration.rb', line 32

def namespace_ancestors
  if parent_in_code
    parent_in_code.namespace_path
  else
    []
  end
end

#namespace_pathObject

Chain of parent_in_code from top level to self. (Includes self.)



28
29
30
# File 'lib/jazzy/source_declaration.rb', line 28

def namespace_path
  namespace_ancestors + [self]
end

#objc_category_nameObject

If this declaration is an objc category, returns an array with the name of the extended objc class and the category name itself, i.e. [“NSString”, “MyMethods”], nil otherwise.



47
48
49
# File 'lib/jazzy/source_declaration.rb', line 47

def objc_category_name
  name.split(/[\(\)]/) if type.objc_category?
end

#overviewObject



70
71
72
# File 'lib/jazzy/source_declaration.rb', line 70

def overview
  "#{abstract}\n\n#{discussion}".strip
end