Class: Shaf::Yard::ProfileMethodHandler
- Inherits:
-
BaseMethodHandler
- Object
- YARD::Handlers::Ruby::Base
- BaseMethodHandler
- Shaf::Yard::ProfileMethodHandler
- Includes:
- Utils
- Defined in:
- lib/shaf/yard/profile_method_handler.rb
Overview
Handles call to Shaf::Serializer::profile
Constant Summary
Constants included from Utils
Instance Method Summary collapse
Methods included from Utils
#bootstrap, deep_symbolize_keys, deep_transform_keys, deep_transform_values, environment, gem_root, iana_link_relations, #in_project_root, #in_project_root?, #is_project_root?, model_name, pluralize, #project_root, #project_root!, rackify_header, read_config, #read_shaf_file, #read_shaf_file!, #read_shaf_upgrade_failure_version, #read_shaf_version, singularize, symbol_or_quoted_string, symbol_string, #write_shaf_file, #write_shaf_file!, #write_shaf_upgrade_failure, #write_shaf_version
Methods inherited from BaseMethodHandler
Instance Method Details
#object ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/shaf/yard/profile_method_handler.rb', line 34 def object # Put the Profile object on the the same namespace level as # the serializer. Typically this it the root namespace ns = namespace.namespace name = shaf_profile&.to_s || self.name name.gsub!(/(Shaf|Profiles)?::/, "") name << "Profile" unless name.end_with? "Profile" ProfileObject.new(ns, name).tap do |obj| obj.dynamic = true obj.profile = shaf_profile end end |
#process ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/shaf/yard/profile_method_handler.rb', line 15 def process serializer = serializer_namespace profile = shaf_profile return unless serializer serializer.profile = profile register object serializer_namespace.profile_objects << object end |