Class: CoachZed::Catalog::Entry
- Inherits:
-
Object
- Object
- CoachZed::Catalog::Entry
- Defined in:
- lib/coach_zed/catalog.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#equipment ⇒ Object
readonly
Returns the value of attribute equipment.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#program ⇒ Object
readonly
Returns the value of attribute program.
-
#relative_path ⇒ Object
readonly
Returns the value of attribute relative_path.
-
#session_duration ⇒ Object
readonly
Returns the value of attribute session_duration.
-
#source_urls ⇒ Object
readonly
Returns the value of attribute source_urls.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#work_items ⇒ Object
readonly
Returns the value of attribute work_items.
Instance Method Summary collapse
- #fingerprint ⇒ Object
-
#initialize(path:, relative_path:, title:, summary:, work_items:, notes:, source_urls:, domain: nil, session_duration: nil, frequency: nil, program: nil, format: nil, equipment: nil) ⇒ Entry
constructor
A new instance of Entry.
- #to_h ⇒ Object
Constructor Details
#initialize(path:, relative_path:, title:, summary:, work_items:, notes:, source_urls:, domain: nil, session_duration: 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 |
# 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, frequency: nil, program: nil, format: nil, equipment: nil ) @path = path @relative_path = relative_path @title = title @domain = domain @session_duration = session_duration @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 ⇒ Object (readonly)
Returns the value of attribute domain.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def domain @domain end |
#equipment ⇒ Object (readonly)
Returns the value of attribute equipment.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def equipment @equipment end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def format @format end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def frequency @frequency end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def notes @notes end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def path @path end |
#program ⇒ Object (readonly)
Returns the value of attribute program.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def program @program end |
#relative_path ⇒ Object (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 ⇒ Object (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 ⇒ Object (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 ⇒ Object (readonly)
Returns the value of attribute summary.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def summary @summary end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/coach_zed/catalog.rb', line 9 def title @title end |
#work_items ⇒ Object (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 ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/coach_zed/catalog.rb', line 41 def fingerprint Digest::SHA256.hexdigest([ relative_path, title, domain, session_duration, frequency, program, format, equipment, summary, work_items.join("\n"), notes.join("\n"), source_urls.join("\n") ].join("\u0000")) end |
#to_h ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/coach_zed/catalog.rb', line 58 def to_h { "path" => path.to_s, "relative_path" => relative_path, "title" => title, "domain" => domain, "session_duration" => session_duration, "frequency" => frequency, "program" => program, "format" => format, "equipment" => equipment, "summary" => summary, "work_items" => work_items, "notes" => notes, "source_urls" => source_urls } end |