Class: Lecture::Slide::Base
- Inherits:
-
Object
- Object
- Lecture::Slide::Base
- Includes:
- Terminal
- Defined in:
- lib/lecture/slide/base.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #display ⇒ Object
-
#initialize(content:, **options) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(content:, **options) ⇒ Base
Returns a new instance of Base.
16 17 18 19 |
# File 'lib/lecture/slide/base.rb', line 16 def initialize(content:, **) @content = content @options = .with_indifferent_access end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object (private)
30 31 32 33 34 35 36 |
# File 'lib/lecture/slide/base.rb', line 30 def method_missing(method_name, *arguments, &block) if .key?(method_name) [method_name] else super end end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
8 9 10 |
# File 'lib/lecture/slide/base.rb', line 8 def content @content end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/lecture/slide/base.rb', line 8 def @options end |
Class Method Details
.inherited(base) ⇒ Object
11 12 13 |
# File 'lib/lecture/slide/base.rb', line 11 def inherited(base) Lecture..add(base.to_s.demodulize.downcase.to_sym) end |
Instance Method Details
#display ⇒ Object
21 22 23 24 25 26 |
# File 'lib/lecture/slide/base.rb', line 21 def display raise( NotImplementedError, "self.#{__method__} must be implemented by including class." ) end |