Class: Wrnap::Rna::Metadata::Container
- Inherits:
-
Object
- Object
- Wrnap::Rna::Metadata::Container
- Defined in:
- lib/wrnap/rna/metadata.rb
Instance Attribute Summary collapse
-
#__data__ ⇒ Object
readonly
Returns the value of attribute __data__.
-
#__rna__ ⇒ Object
readonly
Returns the value of attribute __rna__.
Instance Method Summary collapse
-
#initialize(rna) ⇒ Container
constructor
A new instance of Container.
- #inspect ⇒ Object (also: #to_s)
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(rna) ⇒ Container
Returns a new instance of Container.
27 28 29 |
# File 'lib/wrnap/rna/metadata.rb', line 27 def initialize(rna) @__rna__, @__data__ = rna, {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/wrnap/rna/metadata.rb', line 37 def method_missing(name, *args, &block) case args.size when 0 then __data__[name] when 1 then __data__[name.to_s.gsub(/=$/, "").to_sym] = args.first else super end end |
Instance Attribute Details
#__data__ ⇒ Object (readonly)
Returns the value of attribute __data__.
25 26 27 |
# File 'lib/wrnap/rna/metadata.rb', line 25 def __data__ @__data__ end |
#__rna__ ⇒ Object (readonly)
Returns the value of attribute __rna__.
25 26 27 |
# File 'lib/wrnap/rna/metadata.rb', line 25 def __rna__ @__rna__ end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
31 32 33 |
# File 'lib/wrnap/rna/metadata.rb', line 31 def inspect "#<Metadata: %s>" % __data__.inspect end |