Class: Helium::Library

Inherits:
Resource show all
Defined in:
lib/helium/helium_script.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#id, #params, #type

Instance Method Summary collapse

Methods inherited from Resource

#==, all, all_path, #as_json, create, #created_at, #destroy, #eql?, find, #hash, initialize_from_path, #metadata, resource_name, #resource_name, #resource_path, singleton, #to_json, #update, #updated_at

Methods included from Utils

#datetime_to_iso, #kebab_case

Constructor Details

#initialize(opts = {}) ⇒ Library

Returns a new instance of Library.



21
22
23
24
25
# File 'lib/helium/helium_script.rb', line 21

def initialize(opts = {})
  super(opts)
  @name   = @params.dig('attributes', 'name')
  @digest = @params.dig('meta', 'digest')
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/helium/helium_script.rb', line 19

def name
  @name
end

Instance Method Details

#contentObject



27
28
29
30
# File 'lib/helium/helium_script.rb', line 27

def content
  @content ||= @client.get(resource_path+'/content',
                           content_type: 'application/octet-stream').body
end