Class: Megalith::Author

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(author) ⇒ Author

Returns a new instance of Author.



152
153
154
# File 'lib/megalith/scheme.rb', line 152

def initialize(author)
  @author = author  
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(action, *args) ⇒ Object



156
157
158
# File 'lib/megalith/scheme.rb', line 156

def method_missing(action, *args)
  return @author[action.to_s.to_sym] rescue nil
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



150
151
152
# File 'lib/megalith/scheme.rb', line 150

def author
  @author
end

Instance Method Details

#paramsObject Also known as: available_methods



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

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

#to_hashObject



163
164
165
# File 'lib/megalith/scheme.rb', line 163

def to_hash
  @author
end