Class: AtomicAdmin::Interaction::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/atomic_admin/interaction/base.rb

Direct Known Subclasses

Analytics, JsonForm, Launch, Readonly, Resource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, type:, title: nil, icon: nil, order: 0, **kwargs) ⇒ Base

Returns a new instance of Base.



5
6
7
8
9
10
11
12
# File 'lib/atomic_admin/interaction/base.rb', line 5

def initialize(key:, type:, title: nil, icon: nil, order: 0, **kwargs)
  @key = key
  @type = type
  @title = title
  @icon = icon
  @order = order
  @data = kwargs
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/atomic_admin/interaction/base.rb', line 3

def data
  @data
end

#iconObject

Returns the value of attribute icon.



3
4
5
# File 'lib/atomic_admin/interaction/base.rb', line 3

def icon
  @icon
end

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/atomic_admin/interaction/base.rb', line 3

def key
  @key
end

#orderObject

Returns the value of attribute order.



3
4
5
# File 'lib/atomic_admin/interaction/base.rb', line 3

def order
  @order
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/atomic_admin/interaction/base.rb', line 3

def title
  @title
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/atomic_admin/interaction/base.rb', line 3

def type
  @type
end

Instance Method Details

#resolve(**kwargs) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/atomic_admin/interaction/base.rb', line 14

def resolve(**kwargs)
  {
    key: key,
    type: type,
    title: title,
    icon: icon,
  }
end