Module: GollumRails::Store

Extended by:
ActiveSupport::Concern
Included in:
Page
Defined in:
lib/gollum_rails/store.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

ATTR_READERS =
[]
ATTR_WRITERS =
[:name, :content, :format]
ATTR_ACCESSORS =
[:commit, :gollum_page]

Instance Method Summary collapse

Instance Method Details

#contentObject



43
44
45
# File 'lib/gollum_rails/store.rb', line 43

def content
  @content ||= (@gollum_page.content || "")
end

#filename(ext = true) ⇒ Object

Outputs the pages filename on disc

ext - Wether to output extension or not



39
40
41
# File 'lib/gollum_rails/store.rb', line 39

def filename(ext=true)
  @filename ||= (ext) ? @gollum_page.filename : @gollum_page.filename_stripped
end

#formatObject

Gets the pages format



28
29
30
# File 'lib/gollum_rails/store.rb', line 28

def format
  (@format || (@gollum_page.format||:markdown)).to_sym
end

#nameObject



32
33
34
# File 'lib/gollum_rails/store.rb', line 32

def name
  @name ||= (@gollum_page.name || "")
end

#pageObject

Gets the page class



48
49
50
# File 'lib/gollum_rails/store.rb', line 48

def page
  Adapters::Gollum::Page.new
end