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
33
34
35
|
# File 'lib/landable/configuration.rb', line 33
def api_host
@api_host ||= api_uri.try(:host)
end
|
#api_namespace ⇒ Object
37
38
39
|
# File 'lib/landable/configuration.rb', line 37
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
|
#categories ⇒ Object
63
64
65
66
67
68
69
70
71
72
73
|
# File 'lib/landable/configuration.rb', line 63
def categories
@categories ||= {
'Affiliates' => '',
'PPC' => 'Pay-per-click',
'SEO' => 'Search engine optimization',
'Social' => '',
'Email' => '',
'Traditional' => '',
}
end
|
#database_schema_prefix ⇒ Object
55
56
57
|
# File 'lib/landable/configuration.rb', line 55
def database_schema_prefix
@database_schema_prefix ||= ''
end
|
#partials_to_templates ⇒ Object
75
76
77
|
# File 'lib/landable/configuration.rb', line 75
def partials_to_templates
@partials_to_templates ||= []
end
|
#public_host ⇒ Object
47
48
49
|
# File 'lib/landable/configuration.rb', line 47
def public_host
@public_host ||= public_uri.try(:host)
end
|
#public_namespace ⇒ Object
51
52
53
|
# File 'lib/landable/configuration.rb', line 51
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
23
24
25
|
# File 'lib/landable/configuration.rb', line 23
def publicist_url
@publicist_url ||= 'publicist.dev'
end
|
#reserved_paths ⇒ Object
79
80
81
|
# File 'lib/landable/configuration.rb', line 79
def reserved_paths
@reserved_paths ||= []
end
|
#screenshots_enabled ⇒ Object
99
100
101
|
# File 'lib/landable/configuration.rb', line 99
def screenshots_enabled
@screenshots_enabled ||= false
end
|
#sitemap_additional_paths ⇒ Object
87
88
89
|
# File 'lib/landable/configuration.rb', line 87
def sitemap_additional_paths
@sitemap_additional_paths ||= []
end
|
#sitemap_exclude_categories ⇒ Object
83
84
85
|
# File 'lib/landable/configuration.rb', line 83
def sitemap_exclude_categories
@sitemap_exclude_categories ||= []
end
|
#sitemap_host ⇒ Object
95
96
97
|
# File 'lib/landable/configuration.rb', line 95
def sitemap_host
@sitemap_host
end
|
#sitemap_protocol ⇒ Object
91
92
93
|
# File 'lib/landable/configuration.rb', line 91
def sitemap_protocol
@sitemap_protocol ||= "http"
end
|
#traffic_enabled ⇒ Object
103
104
105
|
# File 'lib/landable/configuration.rb', line 103
def traffic_enabled
@traffic_enabled ||= false
end
|
Instance Method Details
#api_uri ⇒ Object
27
28
29
30
31
|
# File 'lib/landable/configuration.rb', line 27
def api_uri
if api_url.present?
@api_uri ||= URI(api_url)
end
end
|
#authenticators ⇒ Object
13
14
15
|
# File 'lib/landable/configuration.rb', line 13
def authenticators
@authenticators || raise("No Landable authenticator configured.")
end
|
#authenticators=(authenticators) ⇒ Object
Also known as:
authenticator=
17
18
19
|
# File 'lib/landable/configuration.rb', line 17
def authenticators=(authenticators)
@authenticators = Array(authenticators)
end
|
#cors ⇒ Object
112
113
114
|
# File 'lib/landable/configuration.rb', line 112
def cors
@cors ||= CORS.new
end
|
#cors=(bool) ⇒ Object
116
117
118
119
|
# File 'lib/landable/configuration.rb', line 116
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
41
42
43
44
45
|
# File 'lib/landable/configuration.rb', line 41
def public_uri
if public_url.present?
@public_uri ||= URI(public_url)
end
end
|
#screenshots ⇒ Object
135
136
137
|
# File 'lib/landable/configuration.rb', line 135
def screenshots
@screenshots ||= Screenshots.new
end
|