Class: Megalith::Comment
- Inherits:
-
Object
- Object
- Megalith::Comment
- Defined in:
- lib/megalith/scheme.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
Instance Method Summary collapse
-
#initialize(comment) ⇒ Comment
constructor
A new instance of Comment.
- #method_missing(action, *args) ⇒ Object
- #params ⇒ Object (also: #available_methods)
- #to_hash ⇒ Object
Constructor Details
#initialize(comment) ⇒ Comment
Returns a new instance of Comment.
133 134 135 |
# File 'lib/megalith/scheme.rb', line 133 def initialize(comment) @comment = comment end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(action, *args) ⇒ Object
137 138 139 |
# File 'lib/megalith/scheme.rb', line 137 def method_missing(action, *args) return @comment[action.to_s.to_sym] rescue nil end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
131 132 133 |
# File 'lib/megalith/scheme.rb', line 131 def comment @comment end |
Instance Method Details
#params ⇒ Object Also known as: available_methods
141 |
# File 'lib/megalith/scheme.rb', line 141 def params() @comment.keys.map{|k|k.to_sym} ; end |
#to_hash ⇒ Object
144 145 146 |
# File 'lib/megalith/scheme.rb', line 144 def to_hash @comment end |