Class: OpenLoam::Widgets::Widget

Inherits:
Struct
  • Object
show all
Defined in:
lib/open_loam/widgets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#key ⇒ Object

Returns the value of attribute key

Returns:

  • (Object) —

    the current value of key



16
17
18
# File 'lib/open_loam/widgets.rb', line 16

def key
  @key
end

#provider ⇒ Object

Returns the value of attribute provider

Returns:

  • (Object) —

    the current value of provider



16
17
18
# File 'lib/open_loam/widgets.rb', line 16

def provider
  @provider
end

#roles ⇒ Object

Returns the value of attribute roles

Returns:

  • (Object) —

    the current value of roles



16
17
18
# File 'lib/open_loam/widgets.rb', line 16

def roles
  @roles
end

#title ⇒ Object

Returns the value of attribute title

Returns:

  • (Object) —

    the current value of title



16
17
18
# File 'lib/open_loam/widgets.rb', line 16

def title
  @title
end

Instance Method Details

#visible_to?(role) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/open_loam/widgets.rb', line 17

def visible_to?(role)
  roles.nil? || Array(roles).map(&:to_s).include?(role.to_s)
end