Class: Natsukantou::Setup::Component
- Inherits:
-
Object
- Object
- Natsukantou::Setup::Component
- Defined in:
- lib/natsukantou/setup/config_prompt.rb
Instance Attribute Summary collapse
-
#initialize_method ⇒ Object
readonly
Returns the value of attribute initialize_method.
-
#initialize_method_param_tags ⇒ Object
readonly
Returns the value of attribute initialize_method_param_tags.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, path) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(name, path) ⇒ Component
Returns a new instance of Component.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/natsukantou/setup/config_prompt.rb', line 20 def initialize(name, path) @name = name YARD.parse(path) @klass = YARD::Registry.all.find do |item| item.type == :class && item.name == name end @initialize_method = klass.meths.find do |item| item.type == :method && item.name == :initialize end @initialize_method_param_tags = @initialize_method.('param') .reject { |tag| tag.name == 'app' } .map { |tag| MethodParamTagDecorator.new(tag) } YARD::Registry.clear end |
Instance Attribute Details
#initialize_method ⇒ Object (readonly)
Returns the value of attribute initialize_method.
17 18 19 |
# File 'lib/natsukantou/setup/config_prompt.rb', line 17 def initialize_method @initialize_method end |
#initialize_method_param_tags ⇒ Object (readonly)
Returns the value of attribute initialize_method_param_tags.
17 18 19 |
# File 'lib/natsukantou/setup/config_prompt.rb', line 17 def @initialize_method_param_tags end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
17 18 19 |
# File 'lib/natsukantou/setup/config_prompt.rb', line 17 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/natsukantou/setup/config_prompt.rb', line 17 def name @name end |