Class: Rosemary::Note

Inherits:
Object
  • Object
show all
Defined in:
lib/rosemary/note.rb

Overview

The note object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Note

Returns a new instance of Note.



14
15
16
17
18
19
20
21
# File 'lib/rosemary/note.rb', line 14

def initialize(attrs = {})
  attrs.stringify_keys!
  @lat  = attrs['lat']
  @lon  = attrs['lon']
  @text = attrs['text'] || ''
  @user = attrs['user']
  @action = attrs['action'] || ''
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



12
13
14
# File 'lib/rosemary/note.rb', line 12

def action
  @action
end

#idObject

Unique ID



6
7
8
# File 'lib/rosemary/note.rb', line 6

def id
  @id
end

#latObject

Returns the value of attribute lat.



8
9
10
# File 'lib/rosemary/note.rb', line 8

def lat
  @lat
end

#lonObject

Returns the value of attribute lon.



9
10
11
# File 'lib/rosemary/note.rb', line 9

def lon
  @lon
end

#textObject

Returns the value of attribute text.



10
11
12
# File 'lib/rosemary/note.rb', line 10

def text
  @text
end

#userObject

Returns the value of attribute user.



11
12
13
# File 'lib/rosemary/note.rb', line 11

def user
  @user
end