Class: OpenBuildServiceAPI::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/models/source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_hashObject (readonly)

Returns the value of attribute md5_hash.



3
4
5
# File 'lib/models/source.rb', line 3

def md5_hash
  @md5_hash
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/models/source.rb', line 3

def name
  @name
end

#packageObject

Returns the value of attribute package.



4
5
6
# File 'lib/models/source.rb', line 4

def package
  @package
end

#sizeObject (readonly)

Returns the value of attribute size.



3
4
5
# File 'lib/models/source.rb', line 3

def size
  @size
end

#updated_atObject (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_sObject



15
16
17
# File 'lib/models/source.rb', line 15

def to_s
  @name
end