Module: Namaste::Mixin
Class Method Summary collapse
-
.included(base) ⇒ Object
define shortcut methods for dublin kernel values.
Instance Method Summary collapse
-
#dirtype ⇒ Struct::Dirtype
If a Namaste ‘type’ tag is defined, provide structured data.
-
#namaste ⇒ Namaste::Set
Get the set of namaste tags for this directory.
Class Method Details
.included(base) ⇒ Object
define shortcut methods for dublin kernel values
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/namaste/mixin.rb', line 4 def self.included(base) Namaste::DUBLIN_KERNEL.each do |k,v| base.class_eval do define_method(k.to_s) do |*args| namaste[k] end define_method(k.to_s+'=') do |v| namaste[k] = v end end end end |
Instance Method Details
#dirtype ⇒ Struct::Dirtype
If a Namaste ‘type’ tag is defined, provide structured data
26 27 28 29 |
# File 'lib/namaste/mixin.rb', line 26 def dirtype type = namaste[:type] type.first.dirtype unless type.empty? end |
#namaste ⇒ Namaste::Set
Get the set of namaste tags for this directory
20 21 22 |
# File 'lib/namaste/mixin.rb', line 20 def namaste @namaste ||= Namaste::Set.new(self) end |