Class: Viapost::Letter
- Inherits:
-
Object
- Object
- Viapost::Letter
- Defined in:
- lib/viapost/letter.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#number_of_pages ⇒ Object
readonly
Returns the value of attribute number_of_pages.
-
#uploaded_at ⇒ Object
readonly
Returns the value of attribute uploaded_at.
Class Method Summary collapse
Instance Method Summary collapse
- #DateUploaded ⇒ Object
-
#initialize(id, file_name, number_of_pages, uploaded_at) ⇒ Letter
constructor
A new instance of Letter.
- #LetterFileName ⇒ Object
- #LetterID ⇒ Object
- #NumberOfPages ⇒ Object
Constructor Details
#initialize(id, file_name, number_of_pages, uploaded_at) ⇒ Letter
Returns a new instance of Letter.
23 24 25 26 27 28 |
# File 'lib/viapost/letter.rb', line 23 def initialize(id, file_name, number_of_pages, uploaded_at) @id = id @file_name = file_name @number_of_pages = number_of_pages @uploaded_at = uploaded_at end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
5 6 7 |
# File 'lib/viapost/letter.rb', line 5 def file_name @file_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/viapost/letter.rb', line 5 def id @id end |
#number_of_pages ⇒ Object (readonly)
Returns the value of attribute number_of_pages.
5 6 7 |
# File 'lib/viapost/letter.rb', line 5 def number_of_pages @number_of_pages end |
#uploaded_at ⇒ Object (readonly)
Returns the value of attribute uploaded_at.
5 6 7 |
# File 'lib/viapost/letter.rb', line 5 def uploaded_at @uploaded_at end |
Class Method Details
.build_from_soap_object(soap_object) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/viapost/letter.rb', line 30 def self.build_from_soap_object(soap_object) file_name = soap_object.letterFileName id = soap_object.letterID.to_i number_of_pages = soap_object.numberOfPages.to_i uploaded_at = Time.parse(soap_object.dateUploaded) return new(id, file_name, number_of_pages, uploaded_at) end |
Instance Method Details
#DateUploaded ⇒ Object
19 20 21 |
# File 'lib/viapost/letter.rb', line 19 def DateUploaded self.uploaded_at end |
#LetterFileName ⇒ Object
11 12 13 |
# File 'lib/viapost/letter.rb', line 11 def LetterFileName self.file_name end |
#LetterID ⇒ Object
7 8 9 |
# File 'lib/viapost/letter.rb', line 7 def LetterID self.id end |
#NumberOfPages ⇒ Object
15 16 17 |
# File 'lib/viapost/letter.rb', line 15 def NumberOfPages self.number_of_pages end |