Class: ImproveYourCode::Context::AttributeContext
- Inherits:
-
CodeContext
- Object
- CodeContext
- ImproveYourCode::Context::AttributeContext
- Defined in:
- lib/improve_your_code/context/attribute_context.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Attributes inherited from CodeContext
#children, #exp, #parent, #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, #each, #full_name, #local_nodes, #matches?, #number_of_statements, #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.
10 11 12 13 14 |
# File 'lib/improve_your_code/context/attribute_context.rb', line 10 def initialize(exp, send_expression) @visibility = :public @send_expression = send_expression super exp end |
Instance Attribute Details
#visibility ⇒ Object
Returns the value of attribute visibility.
8 9 10 |
# File 'lib/improve_your_code/context/attribute_context.rb', line 8 def visibility @visibility end |
Instance Method Details
#apply_current_visibility(current_visibility) ⇒ Object
24 25 26 |
# File 'lib/improve_your_code/context/attribute_context.rb', line 24 def apply_current_visibility(current_visibility) self.visibility = current_visibility end |
#full_comment ⇒ Object
16 17 18 |
# File 'lib/improve_your_code/context/attribute_context.rb', line 16 def full_comment send_expression.full_comment || '' end |
#instance_method? ⇒ Boolean
20 21 22 |
# File 'lib/improve_your_code/context/attribute_context.rb', line 20 def instance_method? true end |