Class: Ever2boost::NoteList

Inherits:
Object
  • Object
show all
Defined in:
lib/ever2boost/note_list.rb

Constant Summary collapse

DEFAULT_BYTES_NUMBER =
6
FOLDER_COLORS =
[
  '#E10051',
  '#FF8E00',
  '#E8D252',
  '#3FD941',
  '#30D5C8',
  '#2BA5F7',
  '#B013A4'
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: nil, hash: nil, guid: nil, color: nil) ⇒ NoteList

Returns a new instance of NoteList.



19
20
21
22
23
24
25
26
27
# File 'lib/ever2boost/note_list.rb', line 19

def initialize(title: nil, hash: nil, guid: nil, color: nil)
  index = ((Random.new.rand * 7) * 10.floor % 7).to_i
  color = FOLDER_COLORS[index]

  @title = title
  @hash = SecureRandom.hex(DEFAULT_BYTES_NUMBER)
  @guid = guid
  @color = color
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



17
18
19
# File 'lib/ever2boost/note_list.rb', line 17

def color
  @color
end

#guidObject

Returns the value of attribute guid.



17
18
19
# File 'lib/ever2boost/note_list.rb', line 17

def guid
  @guid
end

#hashObject

Returns the value of attribute hash.



17
18
19
# File 'lib/ever2boost/note_list.rb', line 17

def hash
  @hash
end

#titleObject

Returns the value of attribute title.



17
18
19
# File 'lib/ever2boost/note_list.rb', line 17

def title
  @title
end