Class: PlanMyStuff::ProjectMetadata
- Inherits:
-
BaseProjectMetadata
- Object
- BaseMetadata
- BaseProjectMetadata
- PlanMyStuff::ProjectMetadata
- Defined in:
- lib/plan_my_stuff/project_metadata.rb
Overview
Metadata for regular (non-testing) projects.
Constant Summary
Constants inherited from BaseMetadata
Instance Attribute Summary
Attributes inherited from BaseProjectMetadata
Attributes inherited from BaseMetadata
#app_name, #created_by, #custom_fields, #gem_version, #rails_env, #schema_version, #visibility
Class Method Summary collapse
-
.build(user:, visibility: 'internal', custom_fields: {}) ⇒ PlanMyStuff::ProjectMetadata
Builds a new ProjectMetadata for project creation, auto-filling gem defaults.
-
.from_hash(hash) ⇒ PlanMyStuff::ProjectMetadata
Builds a ProjectMetadata from a parsed hash (e.g. from MetadataParser).
Instance Method Summary collapse
-
#initialize ⇒ ProjectMetadata
constructor
A new instance of ProjectMetadata.
Methods inherited from BaseProjectMetadata
Methods inherited from BaseMetadata
#internal?, #public?, #to_h, #to_json, #validate_custom_fields!
Constructor Details
#initialize ⇒ ProjectMetadata
Returns a new instance of ProjectMetadata.
42 43 44 45 |
# File 'lib/plan_my_stuff/project_metadata.rb', line 42 def initialize super @kind = 'project' end |
Class Method Details
.build(user:, visibility: 'internal', custom_fields: {}) ⇒ PlanMyStuff::ProjectMetadata
Builds a new ProjectMetadata for project creation, auto-filling gem defaults
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/plan_my_stuff/project_metadata.rb', line 28 def build(user:, visibility: 'internal', custom_fields: {}) = new apply_common_build( , user: user, visibility: visibility, custom_fields_data: custom_fields, custom_fields_schema: PlanMyStuff.configuration.custom_fields_for(:project), ) .kind = 'project' end |
.from_hash(hash) ⇒ PlanMyStuff::ProjectMetadata
Builds a ProjectMetadata from a parsed hash (e.g. from MetadataParser)
13 14 15 16 17 18 |
# File 'lib/plan_my_stuff/project_metadata.rb', line 13 def from_hash(hash) = new apply_common_from_hash(, hash, PlanMyStuff.configuration.custom_fields_for(:project)) .kind = hash.fetch(:kind, 'project') end |