Class: CoachZed::Catalog::Entry
- Inherits:
-
Object
- Object
- CoachZed::Catalog::Entry
- Defined in:
- lib/coach_zed/catalog.rb,
sig/coach_zed.rbs
Instance Attribute Summary collapse
-
#domain ⇒ String?
readonly
Returns the value of attribute domain.
-
#equipment ⇒ String?
readonly
Returns the value of attribute equipment.
-
#format ⇒ String?
readonly
Returns the value of attribute format.
-
#frequency ⇒ String?
readonly
Returns the value of attribute frequency.
-
#notes ⇒ Array[String]
readonly
Returns the value of attribute notes.
-
#path ⇒ Pathname
readonly
Returns the value of attribute path.
-
#precedence ⇒ String?
readonly
Returns the value of attribute precedence.
-
#program ⇒ String?
readonly
Returns the value of attribute program.
-
#relative_path ⇒ String
readonly
Returns the value of attribute relative_path.
-
#session_duration ⇒ String?
readonly
Returns the value of attribute session_duration.
-
#source_urls ⇒ Array[String]
readonly
Returns the value of attribute source_urls.
-
#summary ⇒ String
readonly
Returns the value of attribute summary.
-
#title ⇒ String
readonly
Returns the value of attribute title.
-
#work_items ⇒ Array[String]
readonly
Returns the value of attribute work_items.
Instance Method Summary collapse
- #fingerprint ⇒ String
-
#initialize(path:, relative_path:, title:, summary:, work_items:, notes:, source_urls:, domain: nil, session_duration: nil, precedence: nil, frequency: nil, program: nil, format: nil, equipment: nil) ⇒ Entry
constructor
A new instance of Entry.
- #to_h ⇒ Hash[String, untyped]
Constructor Details
#initialize(path:, relative_path:, title:, summary:, work_items:, notes:, source_urls:, domain: nil, session_duration: nil, precedence: nil, frequency: nil, program: nil, format: nil, equipment: nil) ⇒ Entry
Returns a new instance of Entry.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/coach_zed/catalog.rb', line 11 def initialize( path:, relative_path:, title:, summary:, work_items:, notes:, source_urls:, domain: nil, session_duration: nil, precedence: nil, frequency: nil, program: nil, format: nil, equipment: nil ) @path = path @relative_path = relative_path @title = title @domain = domain @session_duration = session_duration @precedence = precedence @frequency = frequency @program = program @format = format @equipment = equipment @summary = summary @work_items = work_items @notes = notes @source_urls = source_urls end |
Instance Attribute Details
#domain ⇒ String? (readonly)
Returns the value of attribute domain.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def domain @domain end |
#equipment ⇒ String? (readonly)
Returns the value of attribute equipment.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def equipment @equipment end |
#format ⇒ String? (readonly)
Returns the value of attribute format.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def format @format end |
#frequency ⇒ String? (readonly)
Returns the value of attribute frequency.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def frequency @frequency end |
#notes ⇒ Array[String] (readonly)
Returns the value of attribute notes.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def notes @notes end |
#path ⇒ Pathname (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def path @path end |
#precedence ⇒ String? (readonly)
Returns the value of attribute precedence.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def precedence @precedence end |
#program ⇒ String? (readonly)
Returns the value of attribute program.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def program @program end |
#relative_path ⇒ String (readonly)
Returns the value of attribute relative_path.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def relative_path @relative_path end |
#session_duration ⇒ String? (readonly)
Returns the value of attribute session_duration.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def session_duration @session_duration end |
#source_urls ⇒ Array[String] (readonly)
Returns the value of attribute source_urls.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def source_urls @source_urls end |
#summary ⇒ String (readonly)
Returns the value of attribute summary.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def summary @summary end |
#title ⇒ String (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def title @title end |
#work_items ⇒ Array[String] (readonly)
Returns the value of attribute work_items.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def work_items @work_items end |
Instance Method Details
#fingerprint ⇒ String
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/coach_zed/catalog.rb', line 43 def fingerprint Digest::SHA256.hexdigest([ relative_path, title, domain, session_duration, precedence, frequency, program, format, equipment, summary, work_items.join("\n"), notes.join("\n"), source_urls.join("\n") ].join("\u0000")) end |
#to_h ⇒ Hash[String, untyped]
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/coach_zed/catalog.rb', line 61 def to_h { "path" => path.to_s, "relative_path" => relative_path, "title" => title, "domain" => domain, "session_duration" => session_duration, "precedence" => precedence, "frequency" => frequency, "program" => program, "format" => format, "equipment" => equipment, "summary" => summary, "work_items" => work_items, "notes" => notes, "source_urls" => source_urls } end |