Class: ForemLite::Article
- Inherits:
-
Object
- Object
- ForemLite::Article
- Defined in:
- lib/forem_lite/article.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(options) ⇒ Article
constructor
Article Initializer.
-
#method_missing(method_sym, *arguments, &block) ⇒ String, Object
Intercept NoMethodError exceptions and handle gracefully.
-
#respond_to?(method_sym, include_private = false) ⇒ Boolean, Object
Hook method to return whether the obj can respond to id method or not.
Constructor Details
#initialize(options) ⇒ Article
Article Initializer
10 11 12 |
# File 'lib/forem_lite/article.rb', line 10 def initialize() @raw = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *arguments, &block) ⇒ String, Object
Intercept NoMethodError exceptions and handle gracefully.
23 24 25 26 27 28 29 |
# File 'lib/forem_lite/article.rb', line 23 def method_missing(method_sym, *arguments, &block) if @raw&.keys&.include?(method_sym.to_s) @raw[method_sym.to_s] else super end end |
Instance Attribute Details
#raw ⇒ Object
Returns the value of attribute raw.
3 4 5 |
# File 'lib/forem_lite/article.rb', line 3 def raw @raw end |
Instance Method Details
#respond_to?(method_sym, include_private = false) ⇒ Boolean, Object
Hook method to return whether the obj can respond to id method or not.
39 40 41 42 43 44 45 |
# File 'lib/forem_lite/article.rb', line 39 def respond_to?(method_sym, include_private = false) if @raw&.keys&.include?(method_sym.to_s) true else super end end |