Class: MixinComment::Part
- Inherits:
-
Object
- Object
- MixinComment::Part
- Defined in:
- lib/mixin_comment/part.rb
Constant Summary collapse
- LABELS =
[ 'required methods', 'required class methods', 'required override methods', 'required columns', 'required associations' ]
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#label ⇒ Object
Returns the value of attribute label.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
Instance Method Summary collapse
- #has_errors? ⇒ Boolean
-
#initialize(module_name, label, attributes) ⇒ Part
constructor
A new instance of Part.
- #show_errors ⇒ Object
Constructor Details
#initialize(module_name, label, attributes) ⇒ Part
Returns a new instance of Part.
16 17 18 19 20 21 |
# File 'lib/mixin_comment/part.rb', line 16 def initialize(module_name, label, attributes) @module_name = module_name @label = label @attributes = attributes @errors = [] end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
13 14 15 |
# File 'lib/mixin_comment/part.rb', line 13 def attributes @attributes end |
#errors ⇒ Object
Returns the value of attribute errors.
14 15 16 |
# File 'lib/mixin_comment/part.rb', line 14 def errors @errors end |
#label ⇒ Object
Returns the value of attribute label.
13 14 15 |
# File 'lib/mixin_comment/part.rb', line 13 def label @label end |
#module_name ⇒ Object
Returns the value of attribute module_name.
13 14 15 |
# File 'lib/mixin_comment/part.rb', line 13 def module_name @module_name end |
Instance Method Details
#has_errors? ⇒ Boolean
23 24 25 |
# File 'lib/mixin_comment/part.rb', line 23 def has_errors? @errors.present? end |
#show_errors ⇒ Object
27 28 29 30 31 |
# File 'lib/mixin_comment/part.rb', line 27 def show_errors errors.each do |klass, attr| puts "#{klass}##{attr} is #{label.singularize} by #{module_name}" end end |