Class: Eversign::Models::File
- Inherits:
-
Object
- Object
- Eversign::Models::File
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/eversign/models/file.rb
Instance Attribute Summary collapse
-
#file_base64 ⇒ Object
Returns the value of attribute file_base64.
-
#file_id ⇒ Object
Returns the value of attribute file_id.
-
#file_url ⇒ Object
Returns the value of attribute file_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pages ⇒ Object
Returns the value of attribute pages.
-
#total_pages ⇒ Object
Returns the value of attribute total_pages.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ File
constructor
A new instance of File.
- #only_one_option ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ File
Returns a new instance of File.
11 12 13 |
# File 'lib/eversign/models/file.rb', line 11 def initialize(name=nil) self.name = name end |
Instance Attribute Details
#file_base64 ⇒ Object
Returns the value of attribute file_base64.
7 8 9 |
# File 'lib/eversign/models/file.rb', line 7 def file_base64 @file_base64 end |
#file_id ⇒ Object
Returns the value of attribute file_id.
7 8 9 |
# File 'lib/eversign/models/file.rb', line 7 def file_id @file_id end |
#file_url ⇒ Object
Returns the value of attribute file_url.
7 8 9 |
# File 'lib/eversign/models/file.rb', line 7 def file_url @file_url end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/eversign/models/file.rb', line 7 def name @name end |
#pages ⇒ Object
Returns the value of attribute pages.
7 8 9 |
# File 'lib/eversign/models/file.rb', line 7 def pages @pages end |
#total_pages ⇒ Object
Returns the value of attribute total_pages.
7 8 9 |
# File 'lib/eversign/models/file.rb', line 7 def total_pages @total_pages end |
Instance Method Details
#only_one_option ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/eversign/models/file.rb', line 15 def only_one_option() error = false if file_id && !file_id.empty? error = file_url || file_base64 elsif file_url && !file_url.empty? error = file_id || file_base64 elsif file_base64 && !file_base64.empty? error = file_id || file_url else error = true end errors.add('Please provide only one file option') if error end |