AyuntamientoMadrid/participacion

View on GitHub
app/components/budgets/single_heading_component.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Budgets::SingleHeadingComponent < ApplicationComponent
  attr_reader :budget

  def initialize(budget)
    @budget = budget
  end

  private

    def heading
      budget.headings.first
    end

    def title
      heading.name
    end

    def price
      tag.p budget.formatted_heading_price(heading) if budget.show_money?
    end
end