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 js_engine production_url staging_url review_base_url environment_name ].freeze
Instance Method Summary collapse
- #authentication_type ⇒ Object
-
#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.
24 25 26 27 28 29 30 |
# File 'lib/modulorails/data.rb', line 24 def initialize initialize_from_constants initialize_from_configuration initialize_from_database initialize_from_gem_specs initialize_from_git end |
Instance Method Details
#authentication_type ⇒ Object
51 52 53 |
# File 'lib/modulorails/data.rb', line 51 def authentication_type @authentication_type ||= authentication_data end |
#to_params ⇒ Hash
Returns The payload for the request to the intranet.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/modulorails/data.rb', line 40 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.
34 35 36 |
# File 'lib/modulorails/data.rb', line 34 def to_s ATTRIBUTE_KEYS.map { |key| "#{key}: #{send(key)}" }.join(', ') end |