Class: OpenBuildServiceAPI::Source
- Inherits:
-
Object
- Object
- OpenBuildServiceAPI::Source
- Defined in:
- lib/models/source.rb
Instance Attribute Summary collapse
-
#md5_hash ⇒ Object
readonly
Returns the value of attribute md5_hash.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#package ⇒ Object
Returns the value of attribute package.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Source
constructor
A new instance of Source.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Source
Returns a new instance of Source.
6 7 8 9 10 11 12 13 |
# File 'lib/models/source.rb', line 6 def initialize(params = {}) @name = params[:name] @md5_hash = params[:md5_hash] @size = Filesize.from(params[:size]) @updated_at = Time.at(params[:updated_at]) @package = params[:package] @connection = params[:connection] end |
Instance Attribute Details
#md5_hash ⇒ Object (readonly)
Returns the value of attribute md5_hash.
3 4 5 |
# File 'lib/models/source.rb', line 3 def md5_hash @md5_hash end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/models/source.rb', line 3 def name @name end |
#package ⇒ Object
Returns the value of attribute package.
4 5 6 |
# File 'lib/models/source.rb', line 4 def package @package end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/models/source.rb', line 3 def size @size end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/models/source.rb', line 3 def updated_at @updated_at end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/models/source.rb', line 15 def to_s @name end |