Class: Fusuma::Config::Index

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

Overview

index for config.yml

Defined Under Namespace

Classes: Key

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keys) ⇒ Index

Returns a new instance of Index.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fusuma/config/index.rb', line 8

def initialize(keys)
  @count = 0
  case keys
  when Array
    @keys = []
    @cache_key = keys.map do |key|
      key = Key.new(key) if !key.is_a? Key
      @keys << key
      key.symbol
    end.join(",")
  else
    key = Key.new(keys)
    @cache_key = key.symbol
    @keys = [key]
  end
end

Instance Attribute Details

#cache_keyObject (readonly)

Returns the value of attribute cache_key.



29
30
31
# File 'lib/fusuma/config/index.rb', line 29

def cache_key
  @cache_key
end

#keysObject (readonly)

Returns the value of attribute keys.



29
30
31
# File 'lib/fusuma/config/index.rb', line 29

def keys
  @keys
end

Instance Method Details

#inspectObject



25
26
27
# File 'lib/fusuma/config/index.rb', line 25

def inspect
  @keys.map(&:inspect)
end