Class: Ynl::Models::AttributeSubset

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, superset:, attributes:, doc:) ⇒ AttributeSubset

Returns a new instance of AttributeSubset.



144
145
146
147
148
149
# File 'ynl/lib/ynl/models.rb', line 144

def initialize(name:, superset:, attributes:, doc:)
  @name = name
  @superset = superset
  @attributes = attributes
  @doc = doc
end

Instance Attribute Details

#doc ⇒ Object (readonly)

Returns the value of attribute doc.



142
143
144
# File 'ynl/lib/ynl/models.rb', line 142

def doc
  @doc
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



142
143
144
# File 'ynl/lib/ynl/models.rb', line 142

def name
  @name
end

#superset ⇒ Object (readonly)

Returns the value of attribute superset.



142
143
144
# File 'ynl/lib/ynl/models.rb', line 142

def superset
  @superset
end

Instance Method Details

#attributes ⇒ Object



151
152
153
# File 'ynl/lib/ynl/models.rb', line 151

def attributes
  @attributes
end

#resolve(f) ⇒ Object



155
156
157
158
159
160
# File 'ynl/lib/ynl/models.rb', line 155

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