Class: Asciidoctor::ConfluencePublisher::Model::Base
- Inherits:
-
Object
- Object
- Asciidoctor::ConfluencePublisher::Model::Base
- Defined in:
- lib/asciidoctor/confluence_publisher/model/base.rb
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 11 12 13 |
# File 'lib/asciidoctor/confluence_publisher/model/base.rb', line 5 def initialize(hash = {}) accessor_methods = public_methods(false).select { |mth| mth.to_s =~ /\w+=$/ } hash.each do |key, val| setter_method = "#{key}=" if accessor_methods.include?(setter_method.to_sym) public_send(setter_method, val) end end end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/asciidoctor/confluence_publisher/model/base.rb', line 15 def to_s inspect end |