Class: RhetButler::Includer
- Includes:
- Enumerable
- Defined in:
- lib/rhet-butler/slide-includer.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#slides ⇒ Object
readonly
Returns the value of attribute slides.
Instance Method Summary collapse
- #each ⇒ Object
- #init_with(coder) ⇒ Object
-
#initialize ⇒ Includer
constructor
A new instance of Includer.
- #load(loader) ⇒ Object
Methods inherited from YamlType
#check_config_hash, register, #setup_defaults, #value_from_config
Constructor Details
#initialize ⇒ Includer
Returns a new instance of Includer.
9 10 11 |
# File 'lib/rhet-butler/slide-includer.rb', line 9 def initialize @slides = [] end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
20 21 22 |
# File 'lib/rhet-butler/slide-includer.rb', line 20 def path @path end |
#slides ⇒ Object (readonly)
Returns the value of attribute slides.
21 22 23 |
# File 'lib/rhet-butler/slide-includer.rb', line 21 def @slides end |
Instance Method Details
#each ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/rhet-butler/slide-includer.rb', line 23 def each if block_given? @slides.each{|| yield } else @slides.each end end |
#init_with(coder) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/rhet-butler/slide-includer.rb', line 13 def init_with(coder) unless coder.type == :scalar raise "!include with non-scalar - use a path string" end @path = coder.scalar end |
#load(loader) ⇒ Object
31 32 33 34 35 |
# File 'lib/rhet-butler/slide-includer.rb', line 31 def load(loader) loader = loader.dup @slides = loader.load_file(path) loader end |