# Class Snippet < ActiveRecord::Base

- app/models/snippet.rb

## Schema Information

Table name: snippets

    id         :integer          not null, primary key
    title      :string(255)
    content    :text
    author_id  :integer          not null
    project_id :integer          not null
    created_at :datetime         not null
    updated_at :datetime         not null
    file_name  :string(255)
    expires_at :datetime

Methods

C
  - content_types
D
  - data
E
  - expired?
M
  - mode
N
  - name
S
  - size

Included Modules

- Linguist::BlobHelper

Class Public methods
content_types() Link

Source: show

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

Instance Public methods
data() Link

Source: show

    # File app/models/snippet.rb, line 46
    def data
      content
    end

expired?() Link

Source: show

    # File app/models/snippet.rb, line 62
    def expired?
      expires_at && expires_at < Time.current
    end

mode() Link

Source: show

    # File app/models/snippet.rb, line 58
    def mode
      nil
    end

name() Link

Source: show

    # File app/models/snippet.rb, line 54
    def name
      file_name
    end

size() Link

Source: show

    # File app/models/snippet.rb, line 50
    def size
      0
    end