方法
- A
- F
- I
- N
- S
包含的模块
属性
[R] | node |
类公共方法
attachment_selector() 链接
find_attachment_gallery_nodes(content) 链接
# File actiontext/lib/action_text/attachment_gallery.rb, line 25 def find_attachment_gallery_nodes(content) Fragment.wrap(content).find_all(selector).select do |node| node.children.all? do |child| if child.text? /\A(\n|\ )*\z/.match?(child.text) else child.matches? attachment_selector end end end end
fragment_by_canonicalizing_attachment_galleries(content) 链接
fragment_by_replacing_attachment_gallery_nodes(content) 链接
from_node(node) 链接
new(node) 链接
来源:显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachment_gallery.rb, line 52 def initialize(node) @node = node end
selector() 链接
来源:显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachment_gallery.rb, line 45 def selector "#{TAG_NAME}:has(#{attachment_selector} + #{attachment_selector})" end
实例公共方法
attachments() 链接
来源:显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachment_gallery.rb, line 56 def attachments @attachments ||= node.css(ActionText::AttachmentGallery.attachment_selector).map do |node| ActionText::Attachment.from_node(node).with_full_attributes end end
inspect() 链接
来源:显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachment_gallery.rb, line 66 def inspect "#<#{self.class.name} size=#{size.inspect}>" end
size() 链接
来源:显示 | 在 GitHub 上
# File actiontext/lib/action_text/attachment_gallery.rb, line 62 def size attachments.size end