Class: YARD::I18n::Messages
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Enumerable
|
|
Inherits: | Object |
Defined in: | lib/yard/i18n/messages.rb |
Overview
Acts as a container for Message
objects.
Class Method Summary
-
.new ⇒ Messages
constructor
Creates a new container.
Instance Method Summary
-
#==(other) ⇒ Boolean
Checks if this messages list is equal to another messages list.
- #[](id) ⇒ Message?
-
#each {|message| ... } ⇒ void
Enumerates each
Message
in the container. -
#register(id) ⇒ Message
Registers a
Message
, the message ID of which isid
.
Constructor Details
.new ⇒ Messages
Creates a new container.
# File 'lib/yard/i18n/messages.rb', line 11
def initialize @messages = {} end
Instance Method Details
#==(other) ⇒ Boolean
Checks if this messages list is equal to another messages list.
# File 'lib/yard/i18n/messages.rb', line 45
def ==(other) other.is_a?(self.class) && @messages == other. end
#[](id) ⇒ Message?
# File 'lib/yard/i18n/messages.rb', line 27
def [](id) @messages[id] end
#each {|message| ... } ⇒ void
This method returns an undefined value.
Enumerates each Message
in the container.
# File 'lib/yard/i18n/messages.rb', line 20
def each(&block) @messages.each_value(&block) end