Class: Namaste::Set
- Inherits:
-
Object
- Object
- Namaste::Set
- Defined in:
- lib/namaste/set.rb
Instance Method Summary collapse
-
#[](key = nil) ⇒ Array<Namaste::Tag>
Get only select namaste tags for the directory.
-
#[]=(key, value) ⇒ Object
Set a namaste tag.
-
#all ⇒ Array<Namaste::Tag>
Get all the namaste tags for the directory.
-
#initialize(dir) ⇒ Set
constructor
A new instance of Set.
Constructor Details
#initialize(dir) ⇒ Set
Returns a new instance of Set.
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
16 17 18 |
# File 'lib/namaste/set.rb', line 16 def [] key = nil select(key) end |
#[]=(key, value) ⇒ Object
Set a namaste tag
23 24 25 |
# File 'lib/namaste/set.rb', line 23 def []= key, value Namaste::Tag.new(@dir.path, key, value) end |
#all ⇒ Array<Namaste::Tag>
Get all the namaste tags for the directory
10 11 12 |
# File 'lib/namaste/set.rb', line 10 def all select end |