Class: Hashira::Smells::TypeContext
- Inherits:
-
Data
- Object
- Data
- Hashira::Smells::TypeContext
- Defined in:
- lib/hashira/smells/contexts.rb
Instance Attribute Summary collapse
-
#assigned ⇒ Object
readonly
Returns the value of attribute assigned.
-
#defs ⇒ Object
readonly
Returns the value of attribute defs.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(assigned: nil, **rest) ⇒ TypeContext
constructor
A new instance of TypeContext.
- #line ⇒ Object
- #owned ⇒ Object
- #site ⇒ Object
- #subject ⇒ Object
Constructor Details
#initialize(assigned: nil, **rest) ⇒ TypeContext
Returns a new instance of TypeContext.
55 |
# File 'lib/hashira/smells/contexts.rb', line 55 def initialize(assigned: nil, **rest) = super |
Instance Attribute Details
#assigned ⇒ Object (readonly)
Returns the value of attribute assigned
53 54 55 |
# File 'lib/hashira/smells/contexts.rb', line 53 def assigned @assigned end |
#defs ⇒ Object (readonly)
Returns the value of attribute defs
53 54 55 |
# File 'lib/hashira/smells/contexts.rb', line 53 def defs @defs end |
#file ⇒ Object (readonly)
Returns the value of attribute file
53 54 55 |
# File 'lib/hashira/smells/contexts.rb', line 53 def file @file end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
53 54 55 |
# File 'lib/hashira/smells/contexts.rb', line 53 def kind @kind end |
#name ⇒ Object (readonly)
Returns the value of attribute name
53 54 55 |
# File 'lib/hashira/smells/contexts.rb', line 53 def name @name end |
#node ⇒ Object (readonly)
Returns the value of attribute node
53 54 55 |
# File 'lib/hashira/smells/contexts.rb', line 53 def node @node end |
Instance Method Details
#line ⇒ Object
57 |
# File 'lib/hashira/smells/contexts.rb', line 57 def line = node.location.start_line |
#owned ⇒ Object
61 |
# File 'lib/hashira/smells/contexts.rb', line 61 def owned = defs.reject(&:singleton?) |
#site ⇒ Object
63 |
# File 'lib/hashira/smells/contexts.rb', line 63 def site = "#{file}:#{line}" |
#subject ⇒ Object
59 |
# File 'lib/hashira/smells/contexts.rb', line 59 def subject = name |