Module: HacketyHack::Lessons
- Extended by:
- Lessons
- Included in:
- Lessons
- Defined in:
- lib/hackety_hack/lessons.rb,
lib/hackety_hack/lessons/version.rb,
lib/hackety_hack/lessons/rails/engine.rb
Defined Under Namespace
Modules: Rails
Constant Summary collapse
- FILE_LIST =
Dir["#{File.dirname(__FILE__)}/../../content/*.md"]
- VERSION =
"1.1.2"
Instance Method Summary collapse
- #all ⇒ Object
- #find_by_slug(slug) ⇒ Object
- #find_by_title(title) ⇒ Object
- #slugs ⇒ Object
- #static_directory ⇒ Object
- #titles ⇒ Object
Instance Method Details
#all ⇒ Object
28 29 30 |
# File 'lib/hackety_hack/lessons.rb', line 28 def all FILE_LIST.collect{|file| Metadown.render(File.read(file, :encoding => "utf-8")) } end |
#find_by_slug(slug) ⇒ Object
24 25 26 |
# File 'lib/hackety_hack/lessons.rb', line 24 def find_by_slug(slug) all.find{|data| data.["slug"] == slug} end |
#find_by_title(title) ⇒ Object
20 21 22 |
# File 'lib/hackety_hack/lessons.rb', line 20 def find_by_title(title) all.find{|data| data.["title"] == title} end |
#slugs ⇒ Object
16 17 18 |
# File 'lib/hackety_hack/lessons.rb', line 16 def slugs all.collect{|data| data.["slug"]} end |
#static_directory ⇒ Object
32 33 34 |
# File 'lib/hackety_hack/lessons.rb', line 32 def static_directory "#{File.dirname(__FILE__)}/../../static" end |
#titles ⇒ Object
12 13 14 |
# File 'lib/hackety_hack/lessons.rb', line 12 def titles all.collect{|data| data.["title"]} end |