Class: Ynl::Models::AttributeSet

Inherits:
Object
  • Object
show all
Defined in:
lib/ynl/models.rb

Defined Under Namespace

Classes: Attribute

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



109
110
111
# File 'lib/ynl/models.rb', line 109

def attributes
  @attributes
end

#docObject (readonly)

Returns the value of attribute doc.



109
110
111
# File 'lib/ynl/models.rb', line 109

def doc
  @doc
end

#nameObject (readonly)

Returns the value of attribute name.



109
110
111
# File 'lib/ynl/models.rb', line 109

def name
  @name
end

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