Class: Megalith::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/megalith/scheme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentObject (readonly)

Returns the value of attribute comment.



131
132
133
# File 'lib/megalith/scheme.rb', line 131

def comment
  @comment
end

Instance Method Details

#paramsObject Also known as: available_methods



141
# File 'lib/megalith/scheme.rb', line 141

def params() @comment.keys.map{|k|k.to_sym} ; end

#to_hashObject



144
145
146
# File 'lib/megalith/scheme.rb', line 144

def to_hash
  @comment
end