Class: Ghaki::Meta::Dict::Lookup

Inherits:
Object
  • Object
show all
Defined in:
lib/ghaki/meta/dict/lookup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, opts = {}) ⇒ Lookup

Returns a new instance of Lookup.



11
12
13
14
# File 'lib/ghaki/meta/dict/lookup.rb', line 11

def initialize name, opts={}
  @token   = name
  @storage = opts[:dict_storage] || Storage.new
end

Instance Attribute Details

#storageObject

Returns the value of attribute storage.



9
10
11
# File 'lib/ghaki/meta/dict/lookup.rb', line 9

def storage
  @storage
end

#tokenObject

Returns the value of attribute token.



9
10
11
# File 'lib/ghaki/meta/dict/lookup.rb', line 9

def token
  @token
end

Instance Method Details

#opt_alias(opts, get) ⇒ Object



40
41
42
# File 'lib/ghaki/meta/dict/lookup.rb', line 40

def opt_alias opts, get
  @storage.opt_alias opts, @token, get
end

#opt_plural(opts, get) ⇒ Object



36
37
38
# File 'lib/ghaki/meta/dict/lookup.rb', line 36

def opt_plural opts, get
  @storage.opt_plural opts, @token, get
end

#opt_set(opts, value) ⇒ Object



44
45
46
# File 'lib/ghaki/meta/dict/lookup.rb', line 44

def opt_set opts, value
  @storage.opt_set opts, @token, value
end

#to_sObject



32
33
34
# File 'lib/ghaki/meta/dict/lookup.rb', line 32

def to_s
  @storage.get_snake(@token)
end