Class: PandaDoc::ResponseFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/panda_doc/response_factory.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ ResponseFactory

Returns a new instance of ResponseFactory.



12
13
14
# File 'lib/panda_doc/response_factory.rb', line 12

def initialize(type)
  @type = type.to_s.split('_').map(&:capitalize).join
end

Class Method Details

.build(type) ⇒ Object



8
9
10
# File 'lib/panda_doc/response_factory.rb', line 8

def self.build(type)
  new(type).build
end

Instance Method Details

#buildObject



16
17
18
# File 'lib/panda_doc/response_factory.rb', line 16

def build
  PandaDoc::Objects.const_get(type)
end