Class: Reek::Context::AttributeContext
- Inherits:
-
CodeContext
- Object
- CodeContext
- Reek::Context::AttributeContext
- Defined in:
- lib/reek/context/attribute_context.rb
Overview
A context wrapper for attribute definitions found in a syntax tree.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#send_expression ⇒ Object
readonly
private
Returns the value of attribute send_expression.
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Attributes inherited from CodeContext
#children, #exp, #parent, #refs, #statement_counter
Instance Method Summary collapse
- #apply_current_visibility(current_visibility) ⇒ Object
- #full_comment ⇒ Object
-
#initialize(exp, send_expression) ⇒ AttributeContext
constructor
A new instance of AttributeContext.
- #instance_method? ⇒ Boolean
Methods inherited from CodeContext
#append_child_context, #config_for, #configuration_via_code_commment, #each, #full_name, #local_nodes, #matches?, #number_of_statements, #parent_config_for, #record_call_to, #record_use_of_self, #register_with_parent, #singleton_method?
Constructor Details
#initialize(exp, send_expression) ⇒ AttributeContext
Returns a new instance of AttributeContext.
14 15 16 17 18 |
# File 'lib/reek/context/attribute_context.rb', line 14 def initialize(exp, send_expression) @visibility = :public @send_expression = send_expression super(exp) end |
Instance Attribute Details
#send_expression ⇒ Object (readonly, private)
Returns the value of attribute send_expression.
34 35 36 |
# File 'lib/reek/context/attribute_context.rb', line 34 def send_expression @send_expression end |
#visibility ⇒ Object
Returns the value of attribute visibility.
12 13 14 |
# File 'lib/reek/context/attribute_context.rb', line 12 def visibility @visibility end |
Instance Method Details
#apply_current_visibility(current_visibility) ⇒ Object
28 29 30 |
# File 'lib/reek/context/attribute_context.rb', line 28 def apply_current_visibility(current_visibility) self.visibility = current_visibility end |
#full_comment ⇒ Object
20 21 22 |
# File 'lib/reek/context/attribute_context.rb', line 20 def full_comment send_expression.full_comment || '' end |
#instance_method? ⇒ Boolean
24 25 26 |
# File 'lib/reek/context/attribute_context.rb', line 24 def instance_method? true end |