Sha256: fbb5999762193d2c9146e984594c5ba035c2d2ac8228099d15a8b8350b0e219a

Contents?: true

Size: 598 Bytes

Versions: 4

Compression:

Stored size: 598 Bytes

Contents

class DescribeProject < Struct.new :project_name, :date_format
  def call formatter = formatter, records = records
    formatter.present records
  end

  def project project_name = project_name
    Project.find_by name: project_name
  end

  def records project = project
    project.metrics
  end

  def formatter format = format
    ConsoleFormatter.new format
  end

  def format date_format = date_format
    {
        'Metric' => 'name',
        'Value' => 'value',
        'Changed at' => "last_updated_at.strftime('#{date_format}')",
        'Changed by' => "last_updated_by"
    }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
techcor-0.0.4 lib/commands/describe_project.rb
techcor-0.0.3 lib/commands/describe_project.rb
techcor-0.0.2 lib/commands/describe_project.rb
techcor-0.0.1 lib/commands/describe_project.rb