Class: InstanceSpec

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/instance_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInstanceSpec

Load importer and vars for search instance


5
6
7
8
# File 'app/helpers/instance_spec.rb', line 5

def initialize
  @path = JSON.parse(File.read("app/dataspec/importer.json")).first["Instance Config"]
  get_site_config
end

Instance Attribute Details

#dataspec_pathsObject (readonly)

Returns the value of attribute dataspec_paths


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def dataspec_paths
  @dataspec_paths
end

#faviconObject (readonly)

Returns the value of attribute favicon


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def favicon
  @favicon
end

#logoObject (readonly)

Returns the value of attribute logo


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def 
  @logo
end

#search_titleObject (readonly)

Returns the value of attribute search_title


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def search_title
  @search_title
end

#site_configObject (readonly)

Returns the value of attribute site_config


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def site_config
  @site_config
end

#url_1Object (readonly)

Returns the value of attribute url_1


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def url_1
  @url_1
end

#url_2Object (readonly)

Returns the value of attribute url_2


2
3
4
# File 'app/helpers/instance_spec.rb', line 2

def url_2
  @url_2
end

Instance Method Details

#get_site_configObject

Gets logo, name, info urls, list of dataspecs, etc


11
12
13
14
15
16
17
18
19
# File 'app/helpers/instance_spec.rb', line 11

def get_site_config
  @site_config = JSON.parse(File.read(@path))
  @search_title = @site_config["Search Title"]
  @dataspec_paths = @site_config["Dataset Config"]
  @logo = @site_config["Logo"]
  @favicon = @site_config["Favicon"]
  @url_1 = @site_config["URL 1"]
  @url_2 = @site_config["URL 2"]
end