Class: Asciidoctor::ConfluencePublisher::Model::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoctor/confluence_publisher/model/base.rb

Direct Known Subclasses

Ancestor, Attachment, Page, Property, Space, Version

Instance Method Summary collapse

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_sObject



15
16
17
# File 'lib/asciidoctor/confluence_publisher/model/base.rb', line 15

def to_s
  inspect
end