Class: SBF::Client::Config

Inherits:
TopLevelEntity show all
Includes:
Singleton
Defined in:
lib/stbaldricks/entities/config.rb

Constant Summary

Constants inherited from TopLevelEntity

TopLevelEntity::DEFAULT_CLASS_ACTIONS, TopLevelEntity::DEFAULT_CRUD_ACTIONS, TopLevelEntity::DEFAULT_ENDPOINT, TopLevelEntity::DEFAULT_INSTANCE_ACTIONS

Constants inherited from BaseEntity

BaseEntity::ELSE

Instance Attribute Summary collapse

Attributes inherited from BaseEntity

#errors

Class Method Summary collapse

Methods inherited from TopLevelEntity

_endpoint, action, actions, blacklist_action, class_action, define_endpoint, endpoint, #endpoint, instance_action

Methods included from Entities::Cacheable

#cache_id, included

Methods inherited from BaseEntity

allow_instantiation?, attr_accessor, attr_reader, attr_writer, collection_attributes, defined_attributes, #destroyed?, #dirty_data, entity_attr_accessor, entity_attr_reader, entity_attr_writer, entity_attributes, entity_collection_attr_accessor, entity_collection_attr_reader, entity_collection_attr_writer, #error, inherited, #initialize, #keys_hash, #model_name, multitype_attr_accessor, multitype_attr_reader, multitype_attr_writer, multitype_collection_attr_accessor, multitype_collection_attr_reader, multitype_collection_attr_writer, #not_provided_attributes, optional_attributes, #persisted?, #reload!, #reload_recursive, #rollback!, #to_hash, #to_json, #to_partial

Methods included from EntityResponseConcern

#add_errors, #data, #error?, #errors?, #errors_http_code=, #http_code, #success?

Constructor Details

This class inherits a constructor from SBF::Client::BaseEntity

Instance Attribute Details

#default_yearObject (readonly)

Returns the value of attribute default_year.



14
15
16
# File 'lib/stbaldricks/entities/config.rb', line 14

def default_year
  @default_year
end

#open_registration_yearsObject (readonly)

Returns the value of attribute open_registration_years.



15
16
17
# File 'lib/stbaldricks/entities/config.rb', line 15

def open_registration_years
  @open_registration_years
end

#website_urlObject (readonly)

Returns the value of attribute website_url.



16
17
18
# File 'lib/stbaldricks/entities/config.rb', line 16

def website_url
  @website_url
end

#years_for_baronObject (readonly)

Returns the value of attribute years_for_baron.



21
22
23
# File 'lib/stbaldricks/entities/config.rb', line 21

def years_for_baron
  @years_for_baron
end

#years_for_crusaderObject (readonly)

Returns the value of attribute years_for_crusader.



20
21
22
# File 'lib/stbaldricks/entities/config.rb', line 20

def years_for_crusader
  @years_for_crusader
end

#years_for_knightObject (readonly)

Returns the value of attribute years_for_knight.



18
19
20
# File 'lib/stbaldricks/entities/config.rb', line 18

def years_for_knight
  @years_for_knight
end

#years_for_knight_commanderObject (readonly)

Returns the value of attribute years_for_knight_commander.



19
20
21
# File 'lib/stbaldricks/entities/config.rb', line 19

def years_for_knight_commander
  @years_for_knight_commander
end

#years_for_squireObject (readonly)

Returns the value of attribute years_for_squire.



17
18
19
# File 'lib/stbaldricks/entities/config.rb', line 17

def years_for_squire
  @years_for_squire
end

Class Method Details

.method_missing(method_name, *arguments, &block) ⇒ Object

Attempts to call the method on the cached configuration object rubocop:disable Style/MissingRespondToMissing



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/stbaldricks/entities/config.rb', line 26

def self.method_missing(method_name, *arguments, &block)
  # The first time a missing method is called, call reload to make sure the instance has been populated
  unless @_loaded
    @_loaded = true
    reload
  end

  # If the method being called exists on the instance, call it. Otherwise forward the request on to 'super'.
  return instance.send(method_name) if instance.respond_to?(method_name)

  super(method_name, *arguments, &block)
end