Class: Serverless::Function

Inherits:
Object
  • Object
show all
Defined in:
app/models/serverless/function.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, name, namespace) ⇒ Function

Returns a new instance of Function.


7
8
9
10
11
# File 'app/models/serverless/function.rb', line 7

def initialize(project, name, namespace)
  @project = project
  @name = name
  @namespace = namespace
end

Instance Attribute Details

#nameObject

Returns the value of attribute name


5
6
7
# File 'app/models/serverless/function.rb', line 5

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace


5
6
7
# File 'app/models/serverless/function.rb', line 5

def namespace
  @namespace
end

Class Method Details

.find_by_id(id) ⇒ Object


17
18
19
20
21
22
23
24
# File 'app/models/serverless/function.rb', line 17

def self.find_by_id(id)
  array = id.split("/")
  project = Project.find_by_id(array[0])
  name = array[1]
  namespace = array[2]

  self.new(project, name, namespace)
end

Instance Method Details

#idObject


13
14
15
# File 'app/models/serverless/function.rb', line 13

def id
  @project.id.to_s + "/" + @name + "/" + @namespace
end