Class: Shaf::Profile::Attribute

Inherits:
Object
  • Object
show all
Includes:
UniqueId
Defined in:
lib/shaf/profile/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UniqueId

#__pending_id?, #id

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

#docObject (readonly)

Returns the value of attribute doc.



10
11
12
# File 'lib/shaf/profile/attribute.rb', line 10

def doc
  @doc
end

#hrefObject (readonly)

Returns the value of attribute href.



10
11
12
# File 'lib/shaf/profile/attribute.rb', line 10

def href
  @href
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/shaf/profile/attribute.rb', line 10

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



10
11
12
# File 'lib/shaf/profile/attribute.rb', line 10

def parent
  @parent
end

#typeObject (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

#attributesObject



20
21
22
# File 'lib/shaf/profile/attribute.rb', line 20

def attributes
  @attributes ||= []
end

#relationsObject



24
25
26
# File 'lib/shaf/profile/attribute.rb', line 24

def relations
  @relations ||= []
end