Class: Shaf::Profile::Attribute
- Inherits:
-
Object
- Object
- Shaf::Profile::Attribute
- Includes:
- UniqueId
- Defined in:
- lib/shaf/profile/attribute.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(name, **opts) ⇒ Attribute
constructor
A new instance of Attribute.
- #relations ⇒ Object
Methods included from UniqueId
Constructor Details
#initialize(name, **opts) ⇒ Attribute
Returns a new instance of Attribute.
12 13 14 15 16 17 18 |
# File 'lib/shaf/profile/attribute.rb', line 12 def initialize(name, **opts) @name = name.to_sym @doc = opts[:doc].freeze @href = opts[:href].freeze @type = opts[:type]&.to_s @parent = opts[:parent] end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
10 11 12 |
# File 'lib/shaf/profile/attribute.rb', line 10 def doc @doc end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
10 11 12 |
# File 'lib/shaf/profile/attribute.rb', line 10 def href @href end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/shaf/profile/attribute.rb', line 10 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
10 11 12 |
# File 'lib/shaf/profile/attribute.rb', line 10 def parent @parent end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/shaf/profile/attribute.rb', line 10 def type @type end |
Instance Method Details
#attributes ⇒ Object
20 21 22 |
# File 'lib/shaf/profile/attribute.rb', line 20 def attributes @attributes ||= [] end |
#relations ⇒ Object
24 25 26 |
# File 'lib/shaf/profile/attribute.rb', line 24 def relations @relations ||= [] end |