<commit_before># == Schema Information
#
# Table name: assets
#
#  id                :integer         not null, primary key
#  asset_description :string(255)
#  asset_type        :string(255)
#  status            :string(255)
#  serial_no         :string(255)
#  user_id           :integer
#  cost              :decimal(, )
#  barcode           :string(255)
#  comment           :string(255)
#  date_purchased    :date
#  created_at        :datetime        not null
#  updated_at        :datetime        not null
#
class AssetPdf
  def initialize(asset)
    @asset  = asset
    @pdf = Prawn::Document.new
    asset_intro
    blank_line
    asset_user
    purchase_deets
    blank_line
    render
  end
  
  def asset_intro
    @pdf.text "Asset - JTC#{@asset.id} | #{@asset.asset_description} #{@asset.asset_type}", size: 18, style: :bold
  end
  
  def asset_user
    @pdf.text "This asset is assigned to #{@asset.user.name} and was last changed at #{@asset.updated_at}"
  end
  
  def purchase_deets
    @pdf.text "It was purchased for GBP(#{@asset.cost}) on #{@asset.date_purchased}"
  end
  
  def comment
    @pdf.text "The following issues/comments have been recorded #{@asset.comment}"
  end
  
  def serial
    @pdf.text "For reference the Serial No/IMEI is"
  end
  
  def blank_line
    @pdf.text " "
  end
  
  def render
    @pdf.render
  end
end<commit_msg>slight update to printable pdf<commit_after># == Schema Information
#
# Table name: assets
#
#  id                :integer         not null, primary key
#  asset_description :string(255)
#  asset_type        :string(255)
#  status            :string(255)
#  serial_no         :string(255)
#  user_id           :integer
#  cost              :decimal(, )
#  barcode           :string(255)
#  comment           :string(255)
#  date_purchased    :date
#  created_at        :datetime        not null
#  updated_at        :datetime        not null
#
class AssetPdf
  def initialize(asset)
    @asset  = asset
    @pdf = Prawn::Document.new
    asset_intro
    blank_line
    asset_user
    purchase_deets
    blank_line
    image_blurb
    image
    render
  end
  
  def asset_intro
    @pdf.text "Asset - JTC#{@asset.id} | #{@asset.asset_description} #{@asset.asset_type}", size: 18, style: :bold
  end
  
  def asset_user
    @pdf.text "This asset is assigned to #{@asset.user.name} and was last changed at #{@asset.updated_at}"
  end
  
  def purchase_deets
    @pdf.text "It was purchased for GBP(#{@asset.cost}) on #{@asset.date_purchased}"
  end
  
  def comment
    @pdf.text "The following issues/comments have been recorded #{@asset.comment}"
  end
  
  def serial
    @pdf.text "For reference the Serial No/IMEI is #{@asset.serial_no}"
  end
  
  def blank_line
    @pdf.text " "
  end
  
  def image_blurb
    if @asset.image?
      @pdf.text "The following image has been attached"
    end
  end
  
  def image
    if @asset.image?
      @pdf.image open("public#{@asset.image.url.to_s}")
    end
  end
  
  def render
    @pdf.render
  end
end
{'fraction_non_alphanumeric': 0.10069559456773766, 'fraction_numerical': 0.013249420337860219, 'mean_word_length': 2.300546448087432, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1163739', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1010, 'n_words': 271}