Class: DescribeProject
- Inherits:
-
Struct
- Object
- Struct
- DescribeProject
- Defined in:
- lib/commands/describe_project.rb
Instance Attribute Summary collapse
-
#date_format ⇒ Object
Returns the value of attribute date_format.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
Instance Method Summary collapse
- #call(formatter_class = ConsoleFormatter, records = records) ⇒ Object
- #format(date_format = date_format) ⇒ Object
- #formatter(formatter_class, format = format) ⇒ Object
- #project(project_name = project_name) ⇒ Object
- #records(project = project) ⇒ Object
Instance Attribute Details
#date_format ⇒ Object
Returns the value of attribute date_format
1 2 3 |
# File 'lib/commands/describe_project.rb', line 1 def date_format @date_format end |
#project_name ⇒ Object
Returns the value of attribute project_name
1 2 3 |
# File 'lib/commands/describe_project.rb', line 1 def project_name @project_name end |
Instance Method Details
#call(formatter_class = ConsoleFormatter, records = records) ⇒ Object
2 3 4 |
# File 'lib/commands/describe_project.rb', line 2 def call formatter_class = ConsoleFormatter, records = records formatter(formatter_class).present records end |
#format(date_format = date_format) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/commands/describe_project.rb', line 18 def format date_format = date_format { 'Metric' => 'name', 'Value' => 'last_value', 'Changed at' => "last_updated_at.try :strftime, '#{date_format}'", 'Changed by' => "last_updated_by" } end |
#formatter(formatter_class, format = format) ⇒ Object
14 15 16 |
# File 'lib/commands/describe_project.rb', line 14 def formatter formatter_class, format = format formatter_class.new format end |
#project(project_name = project_name) ⇒ Object
6 7 8 |
# File 'lib/commands/describe_project.rb', line 6 def project project_name = project_name Project.find_by name: project_name end |
#records(project = project) ⇒ Object
10 11 12 |
# File 'lib/commands/describe_project.rb', line 10 def records project = project project.metrics end |