Class: Landable::Configuration
- Inherits:
-
Object
- Object
- Landable::Configuration
show all
- Defined in:
- lib/landable/configuration.rb
Defined Under Namespace
Classes: CORS, Screenshots
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#api_host ⇒ Object
35
36
37
|
# File 'lib/landable/configuration.rb', line 35
def api_host
@api_host ||= api_uri.try(:host)
end
|
#api_namespace ⇒ Object
39
40
41
|
# File 'lib/landable/configuration.rb', line 39
def api_namespace
@api_namespace ||= (api_uri.try(:path).presence || '/api/landable')
end
|
#api_url ⇒ Object
Returns the value of attribute api_url.
3
4
5
|
# File 'lib/landable/configuration.rb', line 3
def api_url
@api_url
end
|
#audit_flags ⇒ Object
53
54
55
|
# File 'lib/landable/configuration.rb', line 53
def audit_flags
@audit_flags ||= []
end
|
#blank_user_agent_string ⇒ Object
145
146
147
|
# File 'lib/landable/configuration.rb', line 145
def blank_user_agent_string
@blank_user_agent_string ||= 'blank'
end
|
#categories ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/landable/configuration.rb', line 69
def categories
@categories ||= {
'Affiliates' => '',
'PPC' => 'Pay-per-click',
'SEO' => 'Search engine optimization',
'Social' => '',
'Email' => '',
'Traditional' => '',
}
end
|
#database_schema_prefix ⇒ Object
61
62
63
|
# File 'lib/landable/configuration.rb', line 61
def database_schema_prefix
@database_schema_prefix ||= ''
end
|
#dnt_enabled ⇒ Object
153
154
155
156
157
|
# File 'lib/landable/configuration.rb', line 153
def dnt_enabled
return true if @dnt_enabled.nil?
@dnt_enabled
end
|
#partials_to_templates ⇒ Object
81
82
83
|
# File 'lib/landable/configuration.rb', line 81
def partials_to_templates
@partials_to_templates ||= []
end
|
#public_host ⇒ Object
49
50
51
|
# File 'lib/landable/configuration.rb', line 49
def public_host
@public_host ||= public_uri.try(:host)
end
|
#public_namespace ⇒ Object
57
58
59
|
# File 'lib/landable/configuration.rb', line 57
def public_namespace
@public_namespace ||= (public_uri.try(:path).presence || '')
end
|
#public_url ⇒ Object
Returns the value of attribute public_url.
3
4
5
|
# File 'lib/landable/configuration.rb', line 3
def public_url
@public_url
end
|
#publicist_url ⇒ Object
25
26
27
|
# File 'lib/landable/configuration.rb', line 25
def publicist_url
@publicist_url ||= 'publicist.dev'
end
|
#reserved_paths ⇒ Object
85
86
87
|
# File 'lib/landable/configuration.rb', line 85
def reserved_paths
@reserved_paths ||= []
end
|
#screenshots_enabled ⇒ Object
105
106
107
|
# File 'lib/landable/configuration.rb', line 105
def screenshots_enabled
@screenshots_enabled ||= false
end
|
#sitemap_additional_paths ⇒ Object
93
94
95
|
# File 'lib/landable/configuration.rb', line 93
def sitemap_additional_paths
@sitemap_additional_paths ||= []
end
|
#sitemap_exclude_categories ⇒ Object
89
90
91
|
# File 'lib/landable/configuration.rb', line 89
def sitemap_exclude_categories
@sitemap_exclude_categories ||= []
end
|
#sitemap_host ⇒ Object
101
102
103
|
# File 'lib/landable/configuration.rb', line 101
def sitemap_host
@sitemap_host
end
|
#sitemap_protocol ⇒ Object
97
98
99
|
# File 'lib/landable/configuration.rb', line 97
def sitemap_protocol
@sitemap_protocol ||= "http"
end
|
#traffic_enabled ⇒ Object
109
110
111
|
# File 'lib/landable/configuration.rb', line 109
def traffic_enabled
@traffic_enabled ||= false
end
|
#untracked_paths ⇒ Object
149
150
151
|
# File 'lib/landable/configuration.rb', line 149
def untracked_paths
@untracked_paths ||= []
end
|
Instance Method Details
#api_uri ⇒ Object
29
30
31
32
33
|
# File 'lib/landable/configuration.rb', line 29
def api_uri
if api_url.present?
@api_uri ||= URI(api_url)
end
end
|
#authenticators ⇒ Object
15
16
17
|
# File 'lib/landable/configuration.rb', line 15
def authenticators
@authenticators || raise("No Landable authenticator configured.")
end
|
#authenticators=(authenticators) ⇒ Object
Also known as:
authenticator=
19
20
21
|
# File 'lib/landable/configuration.rb', line 19
def authenticators=(authenticators)
@authenticators = Array(authenticators)
end
|
#cors ⇒ Object
118
119
120
|
# File 'lib/landable/configuration.rb', line 118
def cors
@cors ||= CORS.new
end
|
#cors=(bool) ⇒ Object
122
123
124
125
|
# File 'lib/landable/configuration.rb', line 122
def cors=(bool)
raise ArgumentError.new("Landable::Configuration#cors should be assigned 'false' to disable CORS support") if bool != false
cors.origins = []
end
|
#public_uri ⇒ Object
43
44
45
46
47
|
# File 'lib/landable/configuration.rb', line 43
def public_uri
if public_url.present?
@public_uri ||= URI(public_url)
end
end
|
#screenshots ⇒ Object
141
142
143
|
# File 'lib/landable/configuration.rb', line 141
def screenshots
@screenshots ||= Screenshots.new
end
|