module HardwareInformation::PurchasedHardware

Constants

COLOUR_PURCHASED_AT_THIS_DATE
#

COLOUR_PURCHASED_AT_THIS_DATE

#
LINUX_YAML
#

LINUX_YAML

A hardcoded path.

#
MAIN_DIV
#

MAIN_DIV

CSS-related Constants are defined next.

#

Public Class Methods

add_bought_at(i) click to toggle source
#

HardwareInformation::PurchasedHardware.add_bought_at

This method will only add non-nil values.

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 156
def self.add_bought_at(i)
  unless i.nil?
    @array_date_bought_at << i
  end
end
add_to_the_total_cost(i) click to toggle source
#

HardwareInformation::PurchasedHardware.add_to_the_total_cost

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 61
def self.add_to_the_total_cost(i)
  @total_cost += i.to_f
end
body_css_class() click to toggle source
#

HardwareInformation::PurchasedHardware.body_css_class

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 31
def self.body_css_class
  'BG_BLACK pad0_4em'
end
body_css_style() click to toggle source
#

HardwareInformation::PurchasedHardware.body_css_style

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 38
  def self.body_css_style
    return '
border-top:  3px solid orange;
border-left: 3px solid orange;
color: #ceffce;
width: 100%;'
  end
bought_at?() click to toggle source
#

HardwareInformation::PurchasedHardware.bought_at?

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 165
def self.bought_at?
  return @array_date_bought_at
end
file_computer_hardware?() click to toggle source
#

HardwareInformation::PurchasedHardware.file_computer_hardware?

All the important data is stored in the following .yml file:

bl /home/x/DATA/PC/OS/LINUX/yaml/computer_hardware.yml
#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 101
def self.file_computer_hardware?
  '/home/x/data/personal/yaml/my_hardware/my_hardware.yml'
end
file_my_hardware() click to toggle source
#

HardwareInformation::PurchasedHardware.file_my_hardware

See:

bl /home/x/data/personal/yaml/my_hardware/my_hardware.yml
#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 113
def self.file_my_hardware
  "/home/x/data/personal/yaml/my_hardware/my_hardware.yml"
end
linux_yaml_directory?() click to toggle source
#

HardwareInformation::PurchasedHardware.linux_yaml_directory?

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 89
def self.linux_yaml_directory?
  LINUX_YAML
end
my_hardware(i = file_my_hardware) click to toggle source
#

HardwareInformation::PurchasedHardware.my_hardware

This method will return the hash I use for the hardware I have purchased over the years.

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 123
def self.my_hardware(i = file_my_hardware)
  YAML.load_file(i)
end
return_dataset_from_the_file_computer_hardware() click to toggle source
#

HardwareInformation::PurchasedHardware.return_dataset_from_the_file_computer_hardware

This will return the dataset stored in the .yml file.

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 139
def self.return_dataset_from_the_file_computer_hardware
  _ = file_computer_hardware?
  if File.exist? _
    return YAML.load_file(_)
  end
end
title?() click to toggle source
#

HardwareInformation::PurchasedHardware.title?

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 24
def self.title?
  'Meine Hardware'
end
total_cost?() click to toggle source
#

HardwareInformation::PurchasedHardware.total_cost?

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 68
def self.total_cost?
  @total_cost
end

Public Instance Methods

main_dataset?() click to toggle source
#

main_dataset?

#
# File lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb, line 130
def main_dataset?
  ::HardwareInformation::PurchasedHardware.my_hardware
end