Class: CodelessCode::FableSet
- Inherits:
-
Object
- Object
- CodelessCode::FableSet
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/codeless_code/fable_set.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
Instance Method Summary collapse
- #fables ⇒ Object
- #filter(filt) ⇒ Object
-
#initialize(dir) ⇒ FableSet
constructor
A new instance of FableSet.
- #lang ⇒ Object
- #translator ⇒ Object
Constructor Details
#initialize(dir) ⇒ FableSet
Returns a new instance of FableSet.
26 27 28 |
# File 'lib/codeless_code/fable_set.rb', line 26 def initialize(dir) self.dir = dir end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
23 24 25 |
# File 'lib/codeless_code/fable_set.rb', line 23 def dir @dir end |
Instance Method Details
#fables ⇒ Object
38 39 40 |
# File 'lib/codeless_code/fable_set.rb', line 38 def fables @fables ||= files.map { |f| Fable.new(f) }.sort_by(&:number) end |
#filter(filt) ⇒ Object
42 43 44 |
# File 'lib/codeless_code/fable_set.rb', line 42 def filter(filt) select { |f| filt.call(f) } end |
#lang ⇒ Object
30 31 32 |
# File 'lib/codeless_code/fable_set.rb', line 30 def lang @lang ||= name_parts.first.to_sym end |
#translator ⇒ Object
34 35 36 |
# File 'lib/codeless_code/fable_set.rb', line 34 def translator @translator ||= name_parts.last end |