Class: MarkdownExec::LinkState
Instance Attribute Summary collapse
-
#block_name ⇒ Object
Returns the value of attribute block_name.
-
#display_menu ⇒ Object
Returns the value of attribute display_menu.
-
#document_filename ⇒ Object
Returns the value of attribute document_filename.
-
#inherited_block_names ⇒ Object
Returns the value of attribute inherited_block_names.
-
#inherited_dependencies ⇒ Object
Returns the value of attribute inherited_dependencies.
-
#keep_code ⇒ Object
Returns the value of attribute keep_code.
-
#prior_block_was_link ⇒ Object
Returns the value of attribute prior_block_was_link.
Class Method Summary collapse
-
.empty ⇒ LinkState
Creates an empty LinkState instance.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Custom equality method to compare LinkState objects.
- #context_code ⇒ Object
- #context_code=(value) ⇒ Object
- #context_code_append(value) ⇒ Object
- #context_code_block ⇒ Object
- #context_code_count ⇒ Object
- #context_code_map(&block) ⇒ Object
- #context_code_present? ⇒ Boolean
-
#initialize(block_name: nil, display_menu: nil, document_filename: nil, inherited_block_names: [], inherited_dependencies: nil, context_code: nil, keep_code: false, prior_block_was_link: nil) ⇒ LinkState
constructor
Initialize the LinkState with keyword arguments for each attribute.
Constructor Details
#initialize(block_name: nil, display_menu: nil, document_filename: nil, inherited_block_names: [], inherited_dependencies: nil, context_code: nil, keep_code: false, prior_block_was_link: nil) ⇒ LinkState
Initialize the LinkState with keyword arguments for each attribute. the inherited blocks.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/link_history.rb', line 23 def initialize( block_name: nil, display_menu: nil, document_filename: nil, inherited_block_names: [], inherited_dependencies: nil, context_code: nil, keep_code: false, prior_block_was_link: nil ) @block_name = block_name = @document_filename = document_filename @inherited_block_names = inherited_block_names @inherited_dependencies = inherited_dependencies # Support both new and deprecated parameter names @context_code = context_code @keep_code = keep_code @prior_block_was_link = prior_block_was_link wwt :link_state, self, caller.deref end |
Instance Attribute Details
#block_name ⇒ Object
Returns the value of attribute block_name.
10 11 12 |
# File 'lib/link_history.rb', line 10 def block_name @block_name end |
#display_menu ⇒ Object
Returns the value of attribute display_menu.
10 11 12 |
# File 'lib/link_history.rb', line 10 def end |
#document_filename ⇒ Object
Returns the value of attribute document_filename.
10 11 12 |
# File 'lib/link_history.rb', line 10 def document_filename @document_filename end |
#inherited_block_names ⇒ Object
Returns the value of attribute inherited_block_names.
10 11 12 |
# File 'lib/link_history.rb', line 10 def inherited_block_names @inherited_block_names end |
#inherited_dependencies ⇒ Object
Returns the value of attribute inherited_dependencies.
10 11 12 |
# File 'lib/link_history.rb', line 10 def inherited_dependencies @inherited_dependencies end |
#keep_code ⇒ Object
Returns the value of attribute keep_code.
10 11 12 |
# File 'lib/link_history.rb', line 10 def keep_code @keep_code end |
#prior_block_was_link ⇒ Object
Returns the value of attribute prior_block_was_link.
10 11 12 |
# File 'lib/link_history.rb', line 10 def prior_block_was_link @prior_block_was_link end |
Class Method Details
.empty ⇒ LinkState
Creates an empty LinkState instance. set to their default values.
43 44 45 |
# File 'lib/link_history.rb', line 43 def self.empty new end |
Instance Method Details
#==(other) ⇒ Boolean
Custom equality method to compare LinkState objects.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/link_history.rb', line 50 def ==(other) other.class == self.class && other.block_name == block_name && other. == && other.document_filename == document_filename && other.inherited_block_names == inherited_block_names && other.inherited_dependencies == inherited_dependencies && other.context_code == context_code && other.keep_code == keep_code && other.prior_block_was_link == prior_block_was_link end |
#context_code ⇒ Object
62 63 64 65 66 |
# File 'lib/link_history.rb', line 62 def context_code @context_code.tap do |ret| pp ['LinkState.context_code() ->', ret] if $pd end end |
#context_code=(value) ⇒ Object
68 69 70 71 72 |
# File 'lib/link_history.rb', line 68 def context_code=(value) @context_code = value.tap do |ret| pp ['LinkState.context_code=() ->', ret, caller.deref(3).last] if $pd end end |
#context_code_append(value) ⇒ Object
74 75 76 77 78 |
# File 'lib/link_history.rb', line 74 def context_code_append(value) @context_code = ((@context_code || []) + value).tap do |ret| pp ['LinkState.context_code_append() ->', ret] if $pd end end |
#context_code_block ⇒ Object
80 81 82 83 84 |
# File 'lib/link_history.rb', line 80 def context_code_block (@context_code || []).join("\n").tap do |ret| pp ['LinkState.context_code_block() ->', ret] if $pd end end |
#context_code_count ⇒ Object
86 87 88 89 90 |
# File 'lib/link_history.rb', line 86 def context_code_count (@context_code&.count || 0).tap do |ret| pp ['LinkState.context_code_count() ->', ret] if $pd end end |
#context_code_map(&block) ⇒ Object
92 93 94 95 96 |
# File 'lib/link_history.rb', line 92 def context_code_map(&block) @context_code.map(&block).tap do |ret| pp ['LinkState.context_code_map() ->', ret] if $pd end end |
#context_code_present? ⇒ Boolean
98 99 100 101 102 |
# File 'lib/link_history.rb', line 98 def context_code_present? @context_code.present?.tap do |ret| pp ['LinkState.context_code_present?() ->', ret] if $pd end end |