Class: Tailmix::Definition::Result::Variant

Inherits:
Struct
  • Object
show all
Defined in:
lib/tailmix/definition/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ariaObject

Returns the value of attribute aria

Returns:

  • (Object)

    the current value of aria



44
45
46
# File 'lib/tailmix/definition/result.rb', line 44

def aria
  @aria
end

#attributesObject

Returns the value of attribute attributes

Returns:

  • (Object)

    the current value of attributes



44
45
46
# File 'lib/tailmix/definition/result.rb', line 44

def attributes
  @attributes
end

#class_groupsObject

Returns the value of attribute class_groups

Returns:

  • (Object)

    the current value of class_groups



44
45
46
# File 'lib/tailmix/definition/result.rb', line 44

def class_groups
  @class_groups
end

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



44
45
46
# File 'lib/tailmix/definition/result.rb', line 44

def data
  @data
end

Instance Method Details

#classesObject



45
46
47
# File 'lib/tailmix/definition/result.rb', line 45

def classes
  class_groups.flat_map { |group| group[:classes] }
end

#to_hObject



49
50
51
52
53
54
55
56
57
# File 'lib/tailmix/definition/result.rb', line 49

def to_h
  {
    classes: classes,
    class_groups: class_groups,
    data: data,
    aria: aria,
    attributes: attributes
  }
end