Sha256: d2e5866efcc8af1d1f0d8429f9364fbd37505c3a8b7aea572afc780cb4d0aea2

Contents?: true

Size: 956 Bytes

Versions: 7

Compression:

Stored size: 956 Bytes

Contents

module PivotalToPdf
  class Story < Pivotal
    def label_text
      return "" if !self.respond_to?(:labels) || self.labels.nil? || self.labels.empty?
      labels
    end

    def points
      return nil unless self.feature?
      "Points: " + (self.respond_to?(:estimate) && !self.estimate.eql?(-1) ? self.estimate.to_s : "Not yet estimated")
    end

    def story_color
      return "52D017" if feature?
      return "FF0000" if bug?
      return "FFFF00" if chore?
      return "000000" # For Releases or Unknown type
    end

    def formatted_name
      formatted_output :name
    end

    def formatted_description
      formatted_output :description
    end

    private

    def formatted_output(field)
      SimpleTextFormatter.new(send(field)).output
    end

    ["feature", "bug", "chore", "release"].each do |type_str|
      class_eval <<-EOS
      def #{type_str}?
      self.story_type == "#{type_str}"
    end
      EOS
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pivotal_to_pdf-1.3.1 lib/pivotal_to_pdf/story.rb
pivotal_to_pdf-1.3.0 lib/pivotal_to_pdf/story.rb
pivotal_to_pdf-1.2.0 lib/pivotal_to_pdf/story.rb
pivotal_to_pdf-1.1.0 lib/pivotal_to_pdf/story.rb
pivotal_to_pdf-1.0.0 lib/pivotal_to_pdf/story.rb
pivotal_to_pdf-0.9.1 lib/pivotal_to_pdf/story.rb
pivotal_to_pdf-0.9 lib/pivotal_to_pdf/story.rb