Class: Ynl::Models::AttributeSet
- Inherits:
-
Object
- Object
- Ynl::Models::AttributeSet
- Defined in:
- lib/ynl/models.rb
Defined Under Namespace
Classes: Attribute
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#name_prefix ⇒ Object
readonly
Returns the value of attribute name_prefix.
Instance Method Summary collapse
-
#initialize(name:, name_prefix:, doc:) ⇒ AttributeSet
constructor
A new instance of AttributeSet.
- #resolve(f) ⇒ Object
Constructor Details
#initialize(name:, name_prefix:, doc:) ⇒ AttributeSet
Returns a new instance of AttributeSet.
111 112 113 114 115 116 |
# File 'lib/ynl/models.rb', line 111 def initialize(name:, name_prefix:, doc:) @name = name @name_prefix = name_prefix @attributes = [] @doc = doc end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
109 110 111 |
# File 'lib/ynl/models.rb', line 109 def attributes @attributes end |
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
109 110 111 |
# File 'lib/ynl/models.rb', line 109 def doc @doc end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
109 110 111 |
# File 'lib/ynl/models.rb', line 109 def name @name end |
#name_prefix ⇒ Object (readonly)
Returns the value of attribute name_prefix.
109 110 111 |
# File 'lib/ynl/models.rb', line 109 def name_prefix @name_prefix end |
Instance Method Details
#resolve(f) ⇒ Object
118 119 120 121 122 123 |
# File 'lib/ynl/models.rb', line 118 def resolve(f) attributes.map! { it.resolve(f) } self rescue raise ParseError, "Failed to resolve attribute set: #{name}" end |