class Snippet

Public Class Methods

content_types() click to toggle source
# File app/models/snippet.rb, line 23
def self.content_types
  [
    ".rb", ".py", ".pl", ".scala", ".c", ".cpp", ".java",
    ".haml", ".html", ".sass", ".scss", ".xml", ".php", ".erb",
    ".js", ".sh", ".coffee", ".yml", ".md"
  ]
end

Public Instance Methods

data() click to toggle source
# File app/models/snippet.rb, line 31
def data
  content
end
expired?() click to toggle source
# File app/models/snippet.rb, line 47
def expired?
  expires_at && expires_at < Time.current
end
mode() click to toggle source
# File app/models/snippet.rb, line 43
def mode
  nil
end
name() click to toggle source
# File app/models/snippet.rb, line 39
def name
  file_name
end
size() click to toggle source
# File app/models/snippet.rb, line 35
def size
  0
end