Class: SparkleFormation::Resources::Resource

Inherits:
Struct
  • Object
show all
Defined in:
lib/sparkle_formation/resources.rb

Overview

Defines a resource type

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



26
27
28
# File 'lib/sparkle_formation/resources.rb', line 26

def name
  @name
end

#propertiesObject

Returns the value of attribute properties

Returns:

  • (Object)

    the current value of properties



26
27
28
# File 'lib/sparkle_formation/resources.rb', line 26

def properties
  @properties
end

#rawObject

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



26
27
28
# File 'lib/sparkle_formation/resources.rb', line 26

def raw
  @raw
end

Instance Method Details

#property(name) ⇒ Property, NilClass

Get property by name

Parameters:

  • name (String)

    name of property

Returns:



31
32
33
34
35
# File 'lib/sparkle_formation/resources.rb', line 31

def property(name)
  properties.detect do |prop|
    prop.name == name
  end
end