Class: Proxy::Omaha::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_omaha/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Metadata

Returns a new instance of Metadata.



5
6
7
8
9
10
11
12
13
# File 'lib/smart_proxy_omaha/metadata.rb', line 5

def initialize(params)
  symbolize_keys_deep!(params)
  @release = params.fetch(:release)
  @architecture = params.fetch(:architecture)
  @sha1_b64 = params.fetch(:sha1_b64)
  @sha256_b64 = params.fetch(:sha256_b64)
  @size = params.fetch(:size)
  @track = params.fetch(:track)
end

Instance Attribute Details

#architectureObject

Returns the value of attribute architecture.



3
4
5
# File 'lib/smart_proxy_omaha/metadata.rb', line 3

def architecture
  @architecture
end

#releaseObject

Returns the value of attribute release.



3
4
5
# File 'lib/smart_proxy_omaha/metadata.rb', line 3

def release
  @release
end

#sha1_b64Object

Returns the value of attribute sha1_b64.



3
4
5
# File 'lib/smart_proxy_omaha/metadata.rb', line 3

def sha1_b64
  @sha1_b64
end

#sha256_b64Object

Returns the value of attribute sha256_b64.



3
4
5
# File 'lib/smart_proxy_omaha/metadata.rb', line 3

def sha256_b64
  @sha256_b64
end

#sizeObject

Returns the value of attribute size.



3
4
5
# File 'lib/smart_proxy_omaha/metadata.rb', line 3

def size
  @size
end

#trackObject

Returns the value of attribute track.



3
4
5
# File 'lib/smart_proxy_omaha/metadata.rb', line 3

def track
  @track
end

Instance Method Details

#to_jsonObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/smart_proxy_omaha/metadata.rb', line 15

def to_json
  {
    :release => release,
    :architecture => architecture,
    :sha1_b64 => sha1_b64,
    :sha256_b64 => sha256_b64,
    :size => size,
    :track => track,
  }.to_json
end