Class: Ever2boost::NoteList
- Inherits:
-
Object
- Object
- Ever2boost::NoteList
- 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
-
#color ⇒ Object
Returns the value of attribute color.
-
#guid ⇒ Object
Returns the value of attribute guid.
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title: nil, hash: nil, guid: nil, color: nil) ⇒ NoteList
constructor
A new instance of NoteList.
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
#color ⇒ Object
Returns the value of attribute color.
17 18 19 |
# File 'lib/ever2boost/note_list.rb', line 17 def color @color end |
#guid ⇒ Object
Returns the value of attribute guid.
17 18 19 |
# File 'lib/ever2boost/note_list.rb', line 17 def guid @guid end |
#hash ⇒ Object
Returns the value of attribute hash.
17 18 19 |
# File 'lib/ever2boost/note_list.rb', line 17 def hash @hash end |
#title ⇒ Object
Returns the value of attribute title.
17 18 19 |
# File 'lib/ever2boost/note_list.rb', line 17 def title @title end |