class Attribute
Describes an attribute type.
@attribute [Integer] The person's age.
Definitions
def self.build(directive, match)
Build an attribute from a directive and match.
Signature
-
parameter
directive
String
The original directive text.
-
parameter
match
MatchData
The regex match data.
Implementation
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)
Initialize a new attribute.
Signature
-
parameter
directive
String
The original directive text.
-
parameter
type
String
The type of the attribute.
Implementation
def initialize(directive, type)
super(directive)
@type = type
end
attr :type
Signature
-
attribute
String
The type of the attribute.