Class: Inch::CodeObject::Proxy::MethodObject
- Inherits:
-
Base
- Object
- Base
- Inch::CodeObject::Proxy::MethodObject
show all
- Defined in:
- lib/inch/code_object/proxy/method_object.rb
Overview
Constant Summary
collapse
- MANY_PARAMETERS_THRESHOLD =
3
- MANY_LINES_THRESHOLD =
20
Instance Attribute Summary
Attributes inherited from Base
#grade, #object_lookup
Instance Method Summary
collapse
Methods inherited from Base
#[], #alias?, #aliased_object, #api_tag?, #children, #constant?, #core?, #depth, #docstring, #evaluation, #filename, #files, #fullname, #has_alias?, #has_children?, #has_code_example?, #has_doc?, #has_multiple_code_examples?, #has_unconsidered_tags?, #in_root?, #initialize, #inspect, #marshal_dump, #marshal_load, #method?, #name, #namespace?, #nodoc?, #original_docstring, #parent, #private?, #protected?, #public?, #tagged_as_internal_api?, #tagged_as_private?, #type, #unconsidered_tag_count, #undocumented?, #visibility
Instance Method Details
#bang_name? ⇒ Boolean
10
11
12
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 10
def bang_name?
self[:bang_name?]
end
|
#constructor? ⇒ Boolean
6
7
8
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 6
def constructor?
self[:constructor?]
end
|
#getter? ⇒ Boolean
14
15
16
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 14
def getter?
self[:getter?]
end
|
#has_many_lines? ⇒ Boolean
28
29
30
31
32
33
34
35
36
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 28
def has_many_lines?
if source
size = source.lines.count
size > MANY_LINES_THRESHOLD
else
false
end
end
|
#has_many_parameters? ⇒ Boolean
23
24
25
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 23
def has_many_parameters?
parameters.size > MANY_PARAMETERS_THRESHOLD
end
|
#has_parameters? ⇒ Boolean
18
19
20
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 18
def has_parameters?
!parameters.empty?
end
|
#overridden? ⇒ Boolean
48
49
50
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 48
def overridden?
self[:overridden?]
end
|
#overridden_method ⇒ Object
52
53
54
55
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 52
def overridden_method
@overridden_method ||=
object_lookup.find(self[:overridden_method_fullname])
end
|
#parameter(name) ⇒ Object
38
39
40
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 38
def parameter(name)
parameters.find { |p| p.name == name.to_s }
end
|
#parameters ⇒ Object
42
43
44
45
46
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 42
def parameters
@parameters ||= self[:parameters].map do |param_attr|
MethodParameterObject.new(param_attr)
end
end
|
#questioning_name? ⇒ Boolean
77
78
79
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 77
def questioning_name?
self[:questioning_name?]
end
|
#return_described? ⇒ Boolean
61
62
63
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 61
def return_described?
self[:return_described?]
end
|
#return_mentioned? ⇒ Boolean
57
58
59
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 57
def return_mentioned?
self[:return_mentioned?]
end
|
#return_typed? ⇒ Boolean
65
66
67
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 65
def return_typed?
self[:return_typed?]
end
|
#setter? ⇒ Boolean
69
70
71
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 69
def setter?
self[:setter?]
end
|
#source ⇒ Object
73
74
75
|
# File 'lib/inch/code_object/proxy/method_object.rb', line 73
def source
self[:source?]
end
|