Class: KDoc::Action

Inherits:
Container show all
Defined in:
lib/k_doc/action.rb

Overview

Action is a DSL for modeling JSON data objects

Instance Attribute Summary collapse

Attributes inherited from Container

#context, #opts, #owner

Attributes included from BlockProcessor

#action_block, #block, #block_state, #children, #depend_on_tags, #dependents, #init_block

Attributes included from Datum

#data

Attributes included from Taggable

#tag_options

Instance Method Summary collapse

Methods inherited from Container

#debug, #os, #owned?

Methods included from BlockProcessor

#action, #actioned?, #add_child, #block_execute, #children_evaluated?, #debug_block_processor, #depend_on, #dependencies_met?, #evaluated?, #execute_block, #fire_action, #fire_children, #fire_eval, #fire_init, #import, #import_data, #init, #initialize_block_processor, #initialized?, #new?, #resolve_dependency

Methods included from Datum

#clear_data, #initialize_data, #set_data

Methods included from Guarded

#clear_errors, #error_hash, #error_messages, #errors, #guard, #log_any_messages, #valid?, #warn

Methods included from Taggable

#initialize_tag, #key, #namespace, #project, #tag, #type

Constructor Details

#initialize(key = nil, **opts, &_block) ⇒ Action

Simple Ruby Action

Parameters:

  • name (String|Symbol)

    Name of the document

  • args (0)
    Type of the document, defaults to KDoc

    FakeOpinion.new.default_action_type if not set

  • default:

    Default value (using named params), as above

  • block (Proc)

    The block is stored and accessed different types in the document loading workflow.



14
15
16
# File 'lib/k_doc/action.rb', line 14

def initialize(key = nil, **opts, &_block)
  super(**{ key: key }.merge(opts))
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



6
7
8
# File 'lib/k_doc/action.rb', line 6

def file
  @file
end