Class: Tenet::Attribute
- Inherits:
-
Object
- Object
- Tenet::Attribute
- Defined in:
- lib/tenet/attribute.rb
Constant Summary collapse
- TYPE_OPTIONS =
[:string, :img, :link]
Instance Attribute Summary collapse
-
#css ⇒ Object
Returns the value of attribute css.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, css:, type: :string) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(name, css:, type: :string) ⇒ Attribute
Returns a new instance of Attribute.
12 13 14 15 16 17 |
# File 'lib/tenet/attribute.rb', line 12 def initialize(name, css:, type: :string) raise ArgumentError unless TYPE_OPTIONS.include?(type) @name = name @css = css @type = type end |
Instance Attribute Details
#css ⇒ Object
Returns the value of attribute css.
5 6 7 |
# File 'lib/tenet/attribute.rb', line 5 def css @css end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/tenet/attribute.rb', line 5 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/tenet/attribute.rb', line 5 def type @type end |