Class: RailsBestPractices::Core::Klass
- Inherits:
-
Object
- Object
- RailsBestPractices::Core::Klass
- Defined in:
- lib/rails_best_practices/core/klasses.rb
Overview
Class info includes clas name, extend class name and module names.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#extend_class_name ⇒ Object
readonly
Returns the value of attribute extend_class_name.
Instance Method Summary collapse
-
#initialize(class_name, extend_class_name, modules) ⇒ Klass
constructor
A new instance of Klass.
- #to_s ⇒ Object
Constructor Details
#initialize(class_name, extend_class_name, modules) ⇒ Klass
Returns a new instance of Klass.
19 20 21 22 23 |
# File 'lib/rails_best_practices/core/klasses.rb', line 19 def initialize(class_name, extend_class_name, modules) @class_name = class_name @extend_class_name = extend_class_name @modules = modules.dup end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
17 18 19 |
# File 'lib/rails_best_practices/core/klasses.rb', line 17 def class_name @class_name end |
#extend_class_name ⇒ Object (readonly)
Returns the value of attribute extend_class_name.
17 18 19 |
# File 'lib/rails_best_practices/core/klasses.rb', line 17 def extend_class_name @extend_class_name end |
Instance Method Details
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rails_best_practices/core/klasses.rb', line 25 def to_s if @modules.empty? @class_name else @modules.map { |modu| "#{modu}::" }.join("") + @class_name end end |