Sha256: dbe603cc8e2c9c1810beeb5cf7670b3420c978f302c3a5f89e3583f7f5ef0a26
Contents?: true
Size: 699 Bytes
Versions: 8
Compression:
Stored size: 699 Bytes
Contents
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2020, by Samuel Williams. require_relative 'tag' module Decode module Comment # Describes an attribute type. # # - `@attribute [Integer] The person's age.` # class Attribute < Tag PATTERN = /\A\[(?<type>.*?)\](\s+(?<details>.*?))?\Z/ def self.build(directive, match) node = self.new(directive, match[:type]) if details = match[:details] node.add(Text.new(details)) end return node end def initialize(directive, type) super(directive) @type = type end # The type of the attribute. # @attribute [String] attr :type end end end
Version data entries
8 entries across 8 versions & 1 rubygems