Class: Namaste::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/namaste/set.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Set

Returns a new instance of Set.

Parameters:



4
5
6
# File 'lib/namaste/set.rb', line 4

def initialize(dir)
  @dir = dir
end

Instance Method Details

#[](key = nil) ⇒ Array<Namaste::Tag>

Get only select namaste tags for the directory

Returns:



16
17
18
# File 'lib/namaste/set.rb', line 16

def [] key = nil
  select(key) 
end

#[]=(key, value) ⇒ Object

Set a namaste tag

Parameters:

  • key (String)
  • value (String)


23
24
25
# File 'lib/namaste/set.rb', line 23

def []= key, value
  Namaste::Tag.new(@dir.path, key, value)
end

#allArray<Namaste::Tag>

Get all the namaste tags for the directory

Returns:



10
11
12
# File 'lib/namaste/set.rb', line 10

def all
  select
end