Class: Logbook::LogEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/logbook/log_entry.rb

Constant Summary collapse

DATE_PROPERTY_NAME =
"Date"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#line_numberObject

Returns the value of attribute line_number

Returns:

  • (Object)

    the current value of line_number



2
3
4
# File 'lib/logbook/log_entry.rb', line 2

def line_number
  @line_number
end

#noteObject

Returns the value of attribute note

Returns:

  • (Object)

    the current value of note



2
3
4
# File 'lib/logbook/log_entry.rb', line 2

def note
  @note
end

#propertiesObject

Returns the value of attribute properties.



5
6
7
# File 'lib/logbook/log_entry.rb', line 5

def properties
  @properties
end

#timeObject

Returns the value of attribute time

Returns:

  • (Object)

    the current value of time



2
3
4
# File 'lib/logbook/log_entry.rb', line 2

def time
  @time
end

Instance Method Details

#recorded_atObject



7
8
9
10
11
12
13
# File 'lib/logbook/log_entry.rb', line 7

def recorded_at
  date = self.properties[DATE_PROPERTY_NAME].value
  time = self.time

  DateTime.parse(date + " " + time)
rescue ArgumentError
end