Class: Resolver

Inherits:
Object
  • Object
show all
Defined in:
frontend/app/models/resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Resolver

Returns a new instance of Resolver.



4
5
6
7
8
9
10
11
12
13
# File 'frontend/app/models/resolver.rb', line 4

def initialize(uri)
  @uri = uri

  jsonmodel_properties = JSONModel.parse_reference(@uri)

  @id = jsonmodel_properties[:id]
  @repository = jsonmodel_properties[:repository]
  @jsonmodel_type = jsonmodel_properties[:type]
  @repo_id = JSONModel.parse_reference(@repository)[:id] if @repository
end

Instance Attribute Details

#repositoryObject (readonly)

Returns the value of attribute repository



2
3
4
# File 'frontend/app/models/resolver.rb', line 2

def repository
  @repository
end

Instance Method Details

#edit_uriObject



16
17
18
19
20
21
22
# File 'frontend/app/models/resolver.rb', line 16

def edit_uri
  uri_properties = default_uri_properties

  uri_properties[:action] = :edit

  uri_properties
end

#view_uriObject



25
26
27
28
29
30
31
# File 'frontend/app/models/resolver.rb', line 25

def view_uri
  uri_properties = default_uri_properties

  uri_properties[:action] = :show

  uri_properties
end