Class: Herb::ActionView::HelperOption

Inherits:
Object
  • Object
show all
Defined in:
lib/herb/action_view/helper_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, maps_to, description) ⇒ HelperOption

: (String, String, String?, String) -> void



533
534
535
536
537
538
# File 'lib/herb/action_view/helper_registry.rb', line 533

def initialize(name, type, maps_to, description)
  @name = name
  @type = type
  @maps_to = maps_to
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

: String



530
531
532
# File 'lib/herb/action_view/helper_registry.rb', line 530

def description
  @description
end

#maps_toObject (readonly)

: String?



529
530
531
# File 'lib/herb/action_view/helper_registry.rb', line 529

def maps_to
  @maps_to
end

#nameObject (readonly)

: String



527
528
529
# File 'lib/herb/action_view/helper_registry.rb', line 527

def name
  @name
end

#typeObject (readonly)

: String



528
529
530
# File 'lib/herb/action_view/helper_registry.rb', line 528

def type
  @type
end

Instance Method Details

#maps_to_aria_attribute?Boolean

: () -> bool

Returns:

  • (Boolean)


544
# File 'lib/herb/action_view/helper_registry.rb', line 544

def maps_to_aria_attribute? = maps_to&.start_with?("aria-") || false

#maps_to_data_attribute?Boolean

: () -> bool

Returns:

  • (Boolean)


541
# File 'lib/herb/action_view/helper_registry.rb', line 541

def maps_to_data_attribute? = maps_to&.start_with?("data-") || false