Class: Helium::Package

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 = {}) ⇒ Package

Returns a new instance of Package.



36
37
38
39
# File 'lib/helium/helium_script.rb', line 36

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



34
35
36
# File 'lib/helium/helium_script.rb', line 34

def name
  @name
end

Instance Method Details

#librariesObject

Libraries are immutable and can be cached



48
49
50
51
# File 'lib/helium/helium_script.rb', line 48

def libraries
  @libs ||= Collection.new(klass: Library, client: @client,
                           belongs_to: self)
end

#scriptObject

Script is immutable and can be cached



42
43
44
45
# File 'lib/helium/helium_script.rb', line 42

def script
  @script ||= Script.initialize_from_path(path: "#{resource_path}/script",
                                           client: @client)
end