Class: MetaCommit::Extension::MarkdownSupport::Diffs::Diff
- Inherits:
-
Contracts::Diff
- Object
- Contracts::Diff
- MetaCommit::Extension::MarkdownSupport::Diffs::Diff
show all
- Includes:
- ContextualAstAccessor
- Defined in:
- lib/meta_commit_markdown_support/diffs/diff.rb
Direct Known Subclasses
AnchorAddition, AnchorDeletion, AnchorRename, CodeAddition, CodeChange, CodeDeletion, ListAddition, ListChange, ListDeletion, TextAddition, TextChange, TextDeletion
Constant Summary
collapse
- SUPPORTED_PARSERS =
[MetaCommit::Extension::MarkdownSupport::Parsers::Markdown]
ContextualAstAccessor::ELEMENT_TYPE_ANCHOR, ContextualAstAccessor::ELEMENT_TYPE_CODE, ContextualAstAccessor::ELEMENT_TYPE_HEADER, ContextualAstAccessor::ELEMENT_TYPE_IMAGE, ContextualAstAccessor::ELEMENT_TYPE_LISTS, ContextualAstAccessor::ELEMENT_TYPE_LIST_ITEM, ContextualAstAccessor::ELEMENT_TYPE_PARAGRAPH, ContextualAstAccessor::ELEMENT_TYPE_TEXT
Instance Method Summary
collapse
#anchor?, #anchor_context?, #anchor_target, #anchor_title, #closest_header_of_list, #code?, #code_context?, #code_first_line, #context_node_neighbours, #context_nodes_on_line, #contextual_ast_has_target_node, #element_closest_to, #elements_of_type_on_line, #header?, #header_content, #image?, #list?, #list_context?, #list_item?, #nested_list_context?, #paragraph?, #paragraph_context?, #parent_list_item_title, #starts_on_line?, #string_content, #text?, #text_context?
Instance Method Details
#inspect ⇒ String
21
22
23
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 21
def inspect
string_representation
end
|
#string_representation ⇒ String
31
32
33
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 31
def string_representation
"perform #{change_context.type}"
end
|
#supports_change(context) ⇒ Boolean
15
16
17
18
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 15
def supports_change(context)
true
end
|
#supports_parser?(parser) ⇒ Boolean
9
10
11
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 9
def supports_parser?(parser)
SUPPORTED_PARSERS.include?(parser)
end
|
#to_s ⇒ String
26
27
28
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 26
def to_s
string_representation
end
|
#type_addition? ⇒ Boolean
36
37
38
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 36
def type_addition?
change_context.type == TYPE_ADDITION
end
|
#type_deletion? ⇒ Boolean
41
42
43
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 41
def type_deletion?
change_context.type == TYPE_DELETION
end
|
#type_replace? ⇒ Boolean
46
47
48
|
# File 'lib/meta_commit_markdown_support/diffs/diff.rb', line 46
def type_replace?
change_context.type == TYPE_REPLACE
end
|