Module: HacketyHack::Lessons
- Extended by:
- Lessons
- Included in:
- Lessons
- Defined in:
- lib/hackety_hack/lessons.rb,
lib/hackety_hack/lessons/version.rb
Constant Summary collapse
- FILE_LIST =
Dir["#{File.dirname(__FILE__)}/../../content/*.md"]
- VERSION =
"1.0.2"
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
22 23 24 |
# File 'lib/hackety_hack/lessons.rb', line 22 def all FILE_LIST.collect{|file| Metadown.render(File.read(file)) } end |
#find_by_slug(slug) ⇒ Object
18 19 20 |
# File 'lib/hackety_hack/lessons.rb', line 18 def find_by_slug(slug) all.find{|data| data.["slug"] == slug} end |
#find_by_title(title) ⇒ Object
14 15 16 |
# File 'lib/hackety_hack/lessons.rb', line 14 def find_by_title(title) all.find{|data| data.["title"] == title} end |
#titles ⇒ Object
10 11 12 |
# File 'lib/hackety_hack/lessons.rb', line 10 def titles all.collect{|data| data.["title"]} end |