Class: Amigo::Vocabulary

Inherits:
Object show all
Defined in:
lib/amigo/vocabulary.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_uri) ⇒ Vocabulary

Returns a new instance of Vocabulary.



7
8
9
# File 'lib/amigo/vocabulary.rb', line 7

def initialize(base_uri)
  @base_uri = base_uri
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)



31
32
33
# File 'lib/amigo/vocabulary.rb', line 31

def method_missing(name, *args, &block)
  self[name]
end

Instance Method Details

#[](name) ⇒ Object



11
12
13
# File 'lib/amigo/vocabulary.rb', line 11

def [](name)
  respond_to?(name) ? send(name) : self << name
end

#typeObject



15
16
17
# File 'lib/amigo/vocabulary.rb', line 15

def type
  self << "type"
end