Class: AttributeStringFactory
- Inherits:
-
Object
- Object
- AttributeStringFactory
- Defined in:
- lib/output/csv/attribute_string_factory.rb
Overview
singleton class to create a formatted String with the attribute names of of the submitted class
Class Method Summary collapse
-
.get_attributes_to_person(person) ⇒ String
method to return the formatted String for the class of the given object.
-
.get_attributes_to_task ⇒ String
method to return the formatted String for the task attributes.
Class Method Details
.get_attributes_to_person(person) ⇒ String
method to return the formatted String for the class of the given object
11 12 13 14 15 16 17 18 |
# File 'lib/output/csv/attribute_string_factory.rb', line 11 def self.get_attributes_to_person(person) case person when Person::Student then return "Name:;Id:;Mat.-Nr.:" when Person::Person then return "Name:;Id:" else raise TypeError, "Invalid class type for factory: #{person.class}" end end |
.get_attributes_to_task ⇒ String
method to return the formatted String for the task attributes
22 23 24 |
# File 'lib/output/csv/attribute_string_factory.rb', line 22 def self.get_attributes_to_task "Task-Id;Description;Start;End" end |