Class: Inch::CodeObject::Proxy::MethodParameterObject

Inherits:
Object
  • Object
show all
Defined in:
lib/inch/code_object/proxy/method_parameter_object.rb

Overview

Proxy class for method parameters

Constant Summary collapse

BAD_NAME_EXCEPTIONS =
%w(id)
BAD_NAME_THRESHOLD =
3

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ MethodParameterObject



6
7
8
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 6

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 10

def [](key)
  @attributes[key]
end

#bad_name?Boolean



18
19
20
21
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 18

def bad_name?
  return false if BAD_NAME_EXCEPTIONS.include?(name)
  name.size < BAD_NAME_THRESHOLD || name =~ /[0-9]$/
end

#block?Boolean



24
25
26
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 24

def block?
  self[:block?]
end

#described?Boolean



29
30
31
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 29

def described?
  self[:described?]
end

#mentioned?Boolean



34
35
36
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 34

def mentioned?
  self[:mentioned?]
end

#nameObject Also known as: fullname



38
39
40
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 38

def name
  self[:name]
end

#splat?Boolean



44
45
46
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 44

def splat?
  self[:splat?]
end

#typed?Boolean



49
50
51
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 49

def typed?
  self[:typed?]
end

#wrongly_mentioned?Boolean



54
55
56
# File 'lib/inch/code_object/proxy/method_parameter_object.rb', line 54

def wrongly_mentioned?
  self[:wrongly_mentioned?]
end