Class: KeytechKit::Note

Inherits:
Object
  • Object
show all
Defined in:
lib/keytechKit/elements/notes/note.rb

Overview

A single note

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Note

Returns a new instance of Note.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/keytechKit/elements/notes/note.rb', line 17

def initialize(data)
  @changedAt = data['ChangedAt']
  @changedBy = data['ChangedBy']
  @changedByLong = data['ChangedByLong']

  @createdAt = data['CreatedAt']
  @createdBy = data['CreatedBy']
  @createdByLong = data['CreatedByLong']

  @id = data['ID'] || 0
  @note_type = data['NoteType']
  @subject = data['Subject']
  @text = data['Text']
end

Instance Attribute Details

#changedAtObject

Returns the value of attribute changedAt.



5
6
7
# File 'lib/keytechKit/elements/notes/note.rb', line 5

def changedAt
  @changedAt
end

#changedByObject

Returns the value of attribute changedBy.



6
7
8
# File 'lib/keytechKit/elements/notes/note.rb', line 6

def changedBy
  @changedBy
end

#changedByLongObject

Returns the value of attribute changedByLong.



7
8
9
# File 'lib/keytechKit/elements/notes/note.rb', line 7

def changedByLong
  @changedByLong
end

#createdAtObject

Returns the value of attribute createdAt.



8
9
10
# File 'lib/keytechKit/elements/notes/note.rb', line 8

def createdAt
  @createdAt
end

#createdByObject

Returns the value of attribute createdBy.



9
10
11
# File 'lib/keytechKit/elements/notes/note.rb', line 9

def createdBy
  @createdBy
end

#createdByLongObject

Returns the value of attribute createdByLong.



10
11
12
# File 'lib/keytechKit/elements/notes/note.rb', line 10

def createdByLong
  @createdByLong
end

#element_keyObject

Returns the value of attribute element_key.



15
16
17
# File 'lib/keytechKit/elements/notes/note.rb', line 15

def element_key
  @element_key
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'lib/keytechKit/elements/notes/note.rb', line 11

def id
  @id
end

#note_typeObject

Returns the value of attribute note_type.



12
13
14
# File 'lib/keytechKit/elements/notes/note.rb', line 12

def note_type
  @note_type
end

#subjectObject

Returns the value of attribute subject.



13
14
15
# File 'lib/keytechKit/elements/notes/note.rb', line 13

def subject
  @subject
end

#textObject

Returns the value of attribute text.



14
15
16
# File 'lib/keytechKit/elements/notes/note.rb', line 14

def text
  @text
end

Instance Method Details

#to_hashObject



32
33
34
# File 'lib/keytechKit/elements/notes/note.rb', line 32

def to_hash
  { NoteType: @note_type, Subject: @subject, Text: @text }
end