Module: ActiveEndpoint::ApplicationHelper
- Defined in:
- app/helpers/active_endpoint/application_helper.rb
Constant Summary collapse
- SETTINGS =
[ :cache_store_client, :cache_prefix, :constraint_limit, :constraint_period, :logger, :log_probe_info, :log_debug_info, :storage_limit, :storage_period, :storage_keep_periods ].freeze
- TAGS_COLORS =
[ 'label-info', 'label-success', 'label-warning', 'label-danger', 'label-default' ].freeze
Instance Method Summary collapse
- #actions ⇒ Object
- #actions_constraints ⇒ Object
- #endpoints ⇒ Object
- #endpoints_constraints ⇒ Object
- #label_for(tag) ⇒ Object
- #resources ⇒ Object
- #resources_constraints ⇒ Object
- #scopes ⇒ Object
- #scopes_constraints ⇒ Object
- #settings ⇒ Object
- #tags ⇒ Object
Instance Method Details
#actions ⇒ Object
53 54 55 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 53 def actions ActiveEndpoint.blacklist.actions end |
#actions_constraints ⇒ Object
73 74 75 76 77 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 73 def actions_constraints ActiveEndpoint.constraints.actions.map do |endpoint, constraints| constraints_for_html(endpoint, constraints) end end |
#endpoints ⇒ Object
45 46 47 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 45 def endpoints ActiveEndpoint.blacklist.endpoints end |
#endpoints_constraints ⇒ Object
61 62 63 64 65 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 61 def endpoints_constraints ActiveEndpoint.constraints.endpoints.map do |endpoint, constraints| constraints_for_html(endpoint, constraints) end end |
#label_for(tag) ⇒ Object
41 42 43 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 41 def label_for(tag) TAGS_COLORS[ActiveEndpoint..definition.keys.index(tag.to_sym)] end |
#resources ⇒ Object
49 50 51 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 49 def resources ActiveEndpoint.blacklist.resources end |
#resources_constraints ⇒ Object
67 68 69 70 71 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 67 def resources_constraints ActiveEndpoint.constraints.resources.map do |endpoint, constraints| constraints_for_html(endpoint, constraints) end end |
#scopes ⇒ Object
57 58 59 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 57 def scopes ActiveEndpoint.blacklist.scopes end |
#scopes_constraints ⇒ Object
79 80 81 82 83 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 79 def scopes_constraints ActiveEndpoint.constraints.scopes.map do |endpoint, constraints| constraints_for_html(endpoint, constraints) end end |
#settings ⇒ Object
24 25 26 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 24 def settings SETTINGS end |
#tags ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/helpers/active_endpoint/application_helper.rb', line 28 def = [] ActiveEndpoint..definition.to_a.each_with_index do |definition, index| << [ definition.first, tag_label_by(index), definition.last, "ActiveEndpoint::Probe.tagged_as(:#{definition.first})" ] end end |