Class: Ynl::Models::AttributeSet

Inherits:
Object
  • Object
show all
Defined in:
ynl/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.



126
127
128
129
130
131
# File 'ynl/lib/ynl/models.rb', line 126

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.



124
125
126
# File 'ynl/lib/ynl/models.rb', line 124

def attributes
  @attributes
end

#doc ⇒ Object (readonly)

Returns the value of attribute doc.



124
125
126
# File 'ynl/lib/ynl/models.rb', line 124

def doc
  @doc
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



124
125
126
# File 'ynl/lib/ynl/models.rb', line 124

def name
  @name
end

#name_prefix ⇒ Object (readonly)

Returns the value of attribute name_prefix.



124
125
126
# File 'ynl/lib/ynl/models.rb', line 124

def name_prefix
  @name_prefix
end

Instance Method Details

#resolve(f) ⇒ Object



133
134
135
136
137
138
# File 'ynl/lib/ynl/models.rb', line 133

def resolve(f)
  attributes.map! { it.resolve(f) }
  self
rescue
  raise ParseError, "Failed to resolve attribute set: #{name}"
end