class Fountain::Note

Fountain Note

Attributes

raw_data[R]

Raw note data

Public Class Methods

new(data) click to toggle source

@param [Hash] data Raw note data

# File lib/fountain/note.rb, line 14
def initialize(data)
  @raw_data = Util.stringify_hash_keys data
end

Public Instance Methods

content() click to toggle source

Content

# File lib/fountain/note.rb, line 24
def content
  raw_data['content']
end
created_at() click to toggle source

Created at

# File lib/fountain/note.rb, line 29
def created_at
  Time.parse raw_data['created_at']
end
id() click to toggle source

Note ID

# File lib/fountain/note.rb, line 19
def id
  raw_data['id']
end
inspect() click to toggle source
# File lib/fountain/note.rb, line 45
def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @id="%<id>s">',
    class_name: self.class.name,
    object_id: object_id,
    id: id
  )
end
updated_at() click to toggle source

Updated at

# File lib/fountain/note.rb, line 34
def updated_at
  Time.parse raw_data['updated_at']
end
user() click to toggle source

User

# File lib/fountain/note.rb, line 39
def user
  return unless raw_data['user'].is_a? Hash

  User.new raw_data['user']
end