Class: Opencdd::EffectiveProperties::Result

Inherits:
Struct
  • Object
show all
Includes:
Enumerable
Defined in:
lib/opencdd/effective_properties.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#propertiesObject

Returns the value of attribute properties

Returns:

  • (Object)

    the current value of properties



7
8
9
# File 'lib/opencdd/effective_properties.rb', line 7

def properties
  @properties
end

#sourcesObject

Returns the value of attribute sources

Returns:

  • (Object)

    the current value of sources



7
8
9
# File 'lib/opencdd/effective_properties.rb', line 7

def sources
  @sources
end

Instance Method Details

#codesObject



29
30
31
# File 'lib/opencdd/effective_properties.rb', line 29

def codes
  properties.map(&:code)
end

#eachObject



10
11
12
13
# File 'lib/opencdd/effective_properties.rb', line 10

def each
  return enum_for(:each) unless block_given?
  properties.each { |p| yield p }
end

#each_propertyObject



15
16
17
18
# File 'lib/opencdd/effective_properties.rb', line 15

def each_property
  return enum_for(:each_property) unless block_given?
  properties.each { |p| yield p }
end

#include?(property) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/opencdd/effective_properties.rb', line 24

def include?(property)
  irdi = property.is_a?(Opencdd::IRDI) ? property : property&.irdi
  properties.any? { |p| p.irdi == irdi }
end

#sizeObject



20
21
22
# File 'lib/opencdd/effective_properties.rb', line 20

def size
  properties.size
end

#to_aObject



33
34
35
# File 'lib/opencdd/effective_properties.rb', line 33

def to_a
  properties.dup
end