Class: Tenet::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/tenet/attribute.rb

Constant Summary collapse

TYPE_OPTIONS =
[:string, :img, :link]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, css:, type: :string) ⇒ Attribute

Returns a new instance of Attribute.

Raises:

  • (ArgumentError)


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

#cssObject

Returns the value of attribute css.



5
6
7
# File 'lib/tenet/attribute.rb', line 5

def css
  @css
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/tenet/attribute.rb', line 5

def name
  @name
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/tenet/attribute.rb', line 5

def type
  @type
end