Class: HakumiComponents::Transfer::Item

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
app/components/hakumi_components/transfer/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, title:, description:, disabled:, class_name:) ⇒ Item

Returns a new instance of Item.



18
19
20
21
22
23
24
# File 'app/components/hakumi_components/transfer/item.rb', line 18

def initialize(key:, title:, description:, disabled:, class_name:)
  @key = key
  @title = title
  @description = description
  @disabled = disabled
  @class_name = class_name
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



39
40
41
# File 'app/components/hakumi_components/transfer/item.rb', line 39

def class_name
  @class_name
end

#descriptionObject (readonly)

Returns the value of attribute description.



33
34
35
# File 'app/components/hakumi_components/transfer/item.rb', line 33

def description
  @description
end

#disabledObject (readonly)

Returns the value of attribute disabled.



36
37
38
# File 'app/components/hakumi_components/transfer/item.rb', line 36

def disabled
  @disabled
end

#keyObject (readonly)

Returns the value of attribute key.



27
28
29
# File 'app/components/hakumi_components/transfer/item.rb', line 27

def key
  @key
end

#titleObject (readonly)

Returns the value of attribute title.



30
31
32
# File 'app/components/hakumi_components/transfer/item.rb', line 30

def title
  @title
end

Instance Method Details

#[](key) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'app/components/hakumi_components/transfer/item.rb', line 42

def [](key)
  case key.to_sym
  when :key then @key
  when :title then @title
  when :description then @description
  when :disabled then @disabled
  when :class_name then @class_name
  else nil
  end
end