Class: StrapiRuby::Config
- Inherits:
-
Object
- Object
- StrapiRuby::Config
- Includes:
- Validations
- Defined in:
- lib/strapi_ruby/config.rb
Instance Attribute Summary collapse
-
#convert_to_datetime ⇒ Object
Returns the value of attribute convert_to_datetime.
-
#convert_to_html ⇒ Object
Returns the value of attribute convert_to_html.
-
#faraday ⇒ Object
Returns the value of attribute faraday.
-
#show_endpoint ⇒ Object
Returns the value of attribute show_endpoint.
-
#strapi_server_uri ⇒ Object
Returns the value of attribute strapi_server_uri.
-
#strapi_token ⇒ Object
Returns the value of attribute strapi_token.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Methods included from Validations
#validate_config, #validate_data_presence, #validate_options
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
12 13 14 15 16 17 18 19 |
# File 'lib/strapi_ruby/config.rb', line 12 def initialize @strapi_server_uri = nil @strapi_token = nil @faraday = nil @convert_to_datetime = true @convert_to_html = [] @show_endpoint = false end |
Instance Attribute Details
#convert_to_datetime ⇒ Object
Returns the value of attribute convert_to_datetime.
5 6 7 |
# File 'lib/strapi_ruby/config.rb', line 5 def convert_to_datetime @convert_to_datetime end |
#convert_to_html ⇒ Object
Returns the value of attribute convert_to_html.
5 6 7 |
# File 'lib/strapi_ruby/config.rb', line 5 def convert_to_html @convert_to_html end |
#faraday ⇒ Object
Returns the value of attribute faraday.
5 6 7 |
# File 'lib/strapi_ruby/config.rb', line 5 def faraday @faraday end |
#show_endpoint ⇒ Object
Returns the value of attribute show_endpoint.
5 6 7 |
# File 'lib/strapi_ruby/config.rb', line 5 def show_endpoint @show_endpoint end |
#strapi_server_uri ⇒ Object
Returns the value of attribute strapi_server_uri.
5 6 7 |
# File 'lib/strapi_ruby/config.rb', line 5 def strapi_server_uri @strapi_server_uri end |
#strapi_token ⇒ Object
Returns the value of attribute strapi_token.
5 6 7 |
# File 'lib/strapi_ruby/config.rb', line 5 def strapi_token @strapi_token end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'lib/strapi_ruby/config.rb', line 21 def call validate_config(self) # We convert to symbols if user passed strings for convert_to_html options @convert_to_html.map!(&:to_sym) end |