Class: DynamicPDFApi::Input
- Inherits:
-
Object
- Object
- DynamicPDFApi::Input
- Defined in:
- lib/ruby_client/Input.rb
Overview
Represents the base class for inputs.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#_resources ⇒ Object
Returns the value of attribute _resources.
-
#_template_id ⇒ Object
Returns the value of attribute _template_id.
-
#_type ⇒ Object
Returns the value of attribute _type.
-
#id ⇒ Object
Gets or sets the id.
-
#resource_name ⇒ Object
Gets or sets the resource name.
Instance Method Summary collapse
- #get_template ⇒ Object
-
#initialize(resource = nil) ⇒ Input
constructor
A new instance of Input.
-
#set_template(template) ⇒ Object
Gets or sets the template.
- #to_json(_options = {}) ⇒ Object
Constructor Details
#initialize(resource = nil) ⇒ Input
Returns a new instance of Input.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ruby_client/Input.rb', line 9 def initialize(resource = nil) @_resources = [] @template = nil @_type = nil @_template_id = nil if resource.is_a?(String) @resource_name = resource elsif !resource.nil? @_resources << resource @resource_name = resource.resource_name end @id = SecureRandom.uuid end |
Instance Attribute Details
#_resources ⇒ Object
Returns the value of attribute _resources.
25 26 27 |
# File 'lib/ruby_client/Input.rb', line 25 def _resources @_resources end |
#_template_id ⇒ Object
Returns the value of attribute _template_id.
25 26 27 |
# File 'lib/ruby_client/Input.rb', line 25 def _template_id @_template_id end |
#_type ⇒ Object
Returns the value of attribute _type.
25 26 27 |
# File 'lib/ruby_client/Input.rb', line 25 def _type @_type end |
#id ⇒ Object
Gets or sets the id.
35 36 37 |
# File 'lib/ruby_client/Input.rb', line 35 def id @id end |
#resource_name ⇒ Object
Gets or sets the resource name.
30 31 32 |
# File 'lib/ruby_client/Input.rb', line 30 def resource_name @resource_name end |
Instance Method Details
#get_template ⇒ Object
45 46 47 |
# File 'lib/ruby_client/Input.rb', line 45 def get_template @template end |
#set_template(template) ⇒ Object
Gets or sets the template.
40 41 42 43 |
# File 'lib/ruby_client/Input.rb', line 40 def set_template(template) @template = template @_template_id = template.id end |
#to_json(_options = {}) ⇒ Object
49 50 51 |
# File 'lib/ruby_client/Input.rb', line 49 def to_json( = {}) JSON.pretty_generate({}) end |