Class: Jazzy::Doc

Inherits:
Mustache
  • Object
show all
Defined in:
lib/jazzy/doc.rb

Instance Method Summary collapse

Instance Method Details



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/jazzy/doc.rb', line 13

def copyright
  config = Config.instance
  copyright = config.copyright || (
    # Fake date is used to keep integration tests consistent
    date = ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d')
    year = date[0..3]
    "© #{year} [#{config.author_name}](#{config.author_url}). " \
    "All rights reserved. (Last updated: #{date})"
  )
  Markdown.render_copyright(copyright).chomp
end

#jazzy_versionObject



25
26
27
28
# File 'lib/jazzy/doc.rb', line 25

def jazzy_version
  # Fake version is used to keep integration tests consistent
  ENV['JAZZY_FAKE_VERSION'] || Jazzy::VERSION
end

#languageObject



34
35
36
# File 'lib/jazzy/doc.rb', line 34

def language
  objc_first? ? 'Objective-C' : 'Swift'
end

#language_stubObject



38
39
40
# File 'lib/jazzy/doc.rb', line 38

def language_stub
  objc_first? ? 'objc' : 'swift'
end

#objc_first?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/jazzy/doc.rb', line 30

def objc_first?
  Config.instance.objc_mode && Config.instance.hide_declarations != 'objc'
end