Class: Jacoat::Document::Meta
- Inherits:
-
Object
- Object
- Jacoat::Document::Meta
- Defined in:
- lib/jacoat/document/meta.rb
Instance Method Summary collapse
-
#initialize(arguments = {}) ⇒ Meta
constructor
A new instance of Meta.
- #method_missing(m, *args) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(arguments = {}) ⇒ Meta
Returns a new instance of Meta.
4 5 6 7 |
# File 'lib/jacoat/document/meta.rb', line 4 def initialize(arguments = {}) @hash = {} (arguments) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/jacoat/document/meta.rb', line 9 def method_missing(m, *args) #setter if /^(\w+)=$/ =~ m @hash[:"#{$1}"] = args[0] end #getter @hash[:"#{m}"] end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 |
# File 'lib/jacoat/document/meta.rb', line 18 def to_hash @hash end |