Class: Toast::ConfigDSL::Single

Inherits:
Object
  • Object
show all
Includes:
Common, DefaultHandlers
Defined in:
lib/toast/config_dsl/single.rb

Instance Method Summary collapse

Methods included from DefaultHandlers

#canonical_delete_handler, #canonical_get_handler, #canonical_patch_handler, #collection_get_handler, #collection_post_handler, #plural_assoc_get_handler, #plural_assoc_link_handler, #plural_assoc_post_handler, #plural_assoc_unlink_handler, #single_get_handler, #singular_assoc_get_handler, #singular_assoc_link_handler, #singular_assoc_unlink_handler

Methods included from Common

#check_symbol_list, #initialize, #method_missing, #raise_config_error, #stack_push

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Toast::ConfigDSL::Common

Instance Method Details

#via_get(&block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/toast/config_dsl/single.rb', line 5

def via_get &block
  stack_push 'via_get' do

    @config_data.via_get =
      OpenStruct.new(permissions: [],
                     handler: single_get_handler(@config_data.model_class, @config_data.name))

    Toast::ConfigDSL::ViaVerb.new(@config_data.via_get).instance_eval &block
  end
end