Class: YARDJS::CodeObjects::PropertyObject

Inherits:
Base
  • Object
show all
Defined in:
lib/yard-js/code_objects/property_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parametersObject

Returns the value of attribute parameters.



4
5
6
# File 'lib/yard-js/code_objects/property_object.rb', line 4

def parameters
  @parameters
end

#property_typeObject

Returns the value of attribute property_type.



4
5
6
# File 'lib/yard-js/code_objects/property_object.rb', line 4

def property_type
  @property_type
end

Instance Method Details

#aliasesObject



6
# File 'lib/yard-js/code_objects/property_object.rb', line 6

def aliases; [] end

#attr_infoObject



31
# File 'lib/yard-js/code_objects/property_object.rb', line 31

def attr_info; nil end

#constructor?Boolean

Returns whether or not the method is the #initialize constructor method.

Returns:

  • (Boolean)

    whether or not the method is the #initialize constructor method



9
10
11
# File 'lib/yard-js/code_objects/property_object.rb', line 9

def constructor?
  name == :constructor && namespace.is_a?(YARD::CodeObjects::ClassObject)
end

#is_alias?Boolean

Tests if the object is defined as an alias of another method

Returns:

  • (Boolean)

    whether the object is an alias



60
61
62
# File 'lib/yard-js/code_objects/property_object.rb', line 60

def is_alias?
  false
end

#is_attribute?Boolean

Tests if the object is defined as an attribute in the namespace

Returns:

  • (Boolean)

    whether the object is an attribute



54
55
56
# File 'lib/yard-js/code_objects/property_object.rb', line 54

def is_attribute?
  false
end

#is_explicit?Boolean

Tests boolean #explicit value.

Returns:

  • (Boolean)

    whether the method is explicitly defined in source



67
68
69
# File 'lib/yard-js/code_objects/property_object.rb', line 67

def is_explicit?
  true
end

#module_function?Boolean

Returns whether or not this method was created as a module function.

Returns:

  • (Boolean)

    whether or not this method was created as a module function

Since:

  • 0.8.0



36
37
38
# File 'lib/yard-js/code_objects/property_object.rb', line 36

def module_function?
  false
end

#overridden_methodMethodObject?

Returns:

  • (MethodObject)

    the object that this method overrides

  • (nil)

    if it does not override a method

Since:

  • 0.6.0



74
75
76
# File 'lib/yard-js/code_objects/property_object.rb', line 74

def overridden_method
  nil
end

#reader?Boolean

Returns whether the method is a reader attribute.

Returns:

  • (Boolean)

    whether the method is a reader attribute

Since:

  • 0.5.3



48
49
50
# File 'lib/yard-js/code_objects/property_object.rb', line 48

def reader?
  true
end

#relative_path(other) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/yard-js/code_objects/property_object.rb', line 13

def relative_path(other)
  case other
  when PropertyObject
    if other.parent == parent
      other.name.to_s
    else
      other.path
    end
  else
    if parent == other
      other.name.to_s
    else
      other.path
    end
  end
end

#scopeObject



30
# File 'lib/yard-js/code_objects/property_object.rb', line 30

def scope; :class end

#valueObject



78
79
80
# File 'lib/yard-js/code_objects/property_object.rb', line 78

def value
  tag(:value) ? tag(:value).text : ''
end

#writer?Boolean

Returns whether the method is a writer attribute.

Returns:

  • (Boolean)

    whether the method is a writer attribute

Since:

  • 0.5.3



42
43
44
# File 'lib/yard-js/code_objects/property_object.rb', line 42

def writer?
  true
end