Class: Fusuma::Config::Index::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/config/index.rb

Overview

Keys in Index

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol_word, skippable: false) ⇒ Key

Returns a new instance of Key.



33
34
35
36
37
38
39
40
41
# File 'lib/fusuma/config/index.rb', line 33

def initialize(symbol_word, skippable: false)
  @symbol = begin
    symbol_word.to_sym
  rescue
    symbol_word
  end

  @skippable = skippable
end

Instance Attribute Details

#skippableObject (readonly)

Returns the value of attribute skippable.



51
52
53
# File 'lib/fusuma/config/index.rb', line 51

def skippable
  @skippable
end

#symbolObject (readonly)

Returns the value of attribute symbol.



51
52
53
# File 'lib/fusuma/config/index.rb', line 51

def symbol
  @symbol
end

Instance Method Details

#inspectObject



43
44
45
46
47
48
49
# File 'lib/fusuma/config/index.rb', line 43

def inspect
  if @skippable
    "#{@symbol}(skippable)"
  else
    @symbol.to_s
  end
end