Class: Modulorails::Data
- Inherits:
-
Object
- Object
- Modulorails::Data
- Defined in:
- lib/modulorails/data.rb
Overview
Author: Matthieu 'ciappa_m' Ciappara This holds the data gathered by the gem. Some come from the configuration by the gem's user. Some are fetched dynamically.
Constant Summary collapse
- ATTRIBUTE_KEYS =
All the data handled by this class
%i[ name main_developer project_manager repository type rails_name ruby_version rails_version bundler_version modulorails_version adapter db_version adapter_version webpacker_version importmap_version jsbundling_version production_url staging_url review_base_url ].freeze
Instance Method Summary collapse
-
#initialize ⇒ Data
constructor
A new instance of Data.
-
#to_params ⇒ Hash
The payload for the request to the intranet.
-
#to_s ⇒ String
Text version of the data.
Constructor Details
#initialize ⇒ Data
Returns a new instance of Data.
23 24 25 26 27 28 29 |
# File 'lib/modulorails/data.rb', line 23 def initialize initialize_from_constants initialize_from_configuration initialize_from_database initialize_from_gem_specs initialize_from_git end |
Instance Method Details
#to_params ⇒ Hash
Returns The payload for the request to the intranet.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/modulorails/data.rb', line 39 def to_params { 'name' => @name, 'main_developer' => @main_developer, 'project_manager' => @project_manager, 'repository' => @repository, 'app_type' => @type, 'project_data' => to_project_data_params } end |
#to_s ⇒ String
Returns Text version of the data.
33 34 35 |
# File 'lib/modulorails/data.rb', line 33 def to_s ATTRIBUTE_KEYS.map { |key| "#{key}: #{send(key)}" }.join(', ') end |