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.
- #inherited_lines ⇒ Object
- #inherited_lines=(value) ⇒ Object
- #inherited_lines_append(value) ⇒ Object
- #inherited_lines_block ⇒ Object
- #inherited_lines_count ⇒ Object
- #inherited_lines_map ⇒ Object
- #inherited_lines_present? ⇒ Boolean
-
#initialize(block_name: nil, display_menu: nil, document_filename: nil, inherited_block_names: [], inherited_dependencies: nil, inherited_lines: 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, inherited_lines: nil, keep_code: false, prior_block_was_link: nil) ⇒ LinkState
Initialize the LinkState with keyword arguments for each attribute.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/link_history.rb', line 20 def initialize(block_name: nil, display_menu: nil, document_filename: nil, inherited_block_names: [], inherited_dependencies: nil, inherited_lines: nil, keep_code: false, prior_block_was_link: nil) @block_name = block_name @display_menu = @document_filename = document_filename @inherited_block_names = inherited_block_names @inherited_dependencies = inherited_dependencies @inherited_lines = inherited_lines @keep_code = keep_code @prior_block_was_link = prior_block_was_link 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 @display_menu 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.
35 36 37 |
# File 'lib/link_history.rb', line 35 def self.empty new end |
Instance Method Details
#==(other) ⇒ Boolean
Custom equality method to compare LinkState objects.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/link_history.rb', line 42 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.inherited_lines == inherited_lines && other.keep_code == keep_code && other.prior_block_was_link == prior_block_was_link end |
#inherited_lines ⇒ Object
54 55 56 57 58 |
# File 'lib/link_history.rb', line 54 def inherited_lines @inherited_lines.tap { |ret| pp ['LinkState.inherited_lines() ->', ret] if $pd } end |
#inherited_lines=(value) ⇒ Object
60 61 62 63 64 |
# File 'lib/link_history.rb', line 60 def inherited_lines=(value) @inherited_lines = value.tap { |ret| pp ['LinkState.inherited_lines=() ->', ret] if $pd } end |
#inherited_lines_append(value) ⇒ Object
66 67 68 69 70 |
# File 'lib/link_history.rb', line 66 def inherited_lines_append(value) @inherited_lines = ((@inherited_lines || []) + value).tap { |ret| pp ['LinkState.inherited_lines_append() ->', ret] if $pd } end |
#inherited_lines_block ⇒ Object
72 73 74 75 76 |
# File 'lib/link_history.rb', line 72 def inherited_lines_block (@inherited_lines || []).join("\n").tap { |ret| pp ['LinkState.inherited_lines_block() ->', ret] if $pd } end |
#inherited_lines_count ⇒ Object
78 79 80 81 82 |
# File 'lib/link_history.rb', line 78 def inherited_lines_count (@inherited_lines&.count || 0).tap { |ret| pp ['LinkState.inherited_lines_count() ->', ret] if $pd } end |
#inherited_lines_map ⇒ Object
84 85 86 87 88 |
# File 'lib/link_history.rb', line 84 def inherited_lines_map @inherited_lines.map do |line| yield line end.tap { |ret| pp ['LinkState.inherited_lines_map() ->', ret] if $pd } end |
#inherited_lines_present? ⇒ Boolean
90 91 92 93 94 |
# File 'lib/link_history.rb', line 90 def inherited_lines_present? @inherited_lines.present?.tap { |ret| pp ['LinkState.inherited_lines_present?() ->', ret] if $pd } end |