Class: Easy::Configuration::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/easy/configuration/entity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass_name) ⇒ Entity

Returns a new instance of Entity.



7
8
9
10
11
# File 'lib/easy/configuration/entity.rb', line 7

def initialize(klass_name)
  @klass_name   = klass_name
  @no_count     = false
  @menu         = Hash.new { |hash, key| hash[key.to_s] = Menu.new }
end

Instance Attribute Details

#no_countObject

Returns the value of attribute no_count.



5
6
7
# File 'lib/easy/configuration/entity.rb', line 5

def no_count
  @no_count
end

Instance Method Details



17
18
19
20
21
22
23
# File 'lib/easy/configuration/entity.rb', line 17

def menu(section, &block)
  if block_given?
    yield @menu[section.to_s]
  else
    @menu[section.to_s]
  end
end

#no_count?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/easy/configuration/entity.rb', line 13

def no_count?
  !!no_count
end