Module: Noah::Linkable
- Included in:
- Application, Configuration, Ephemeral, Host, Service, Token
- Defined in:
- lib/noah/linkable.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#link!(link_name) ⇒ Object
7 8 9 10 11 |
# File 'lib/noah/linkable.rb', line 7 def link!(link_name) link = Noah::Link.find_or_create(:path => link_name) link.nodes = self links << link end |
#to_hash ⇒ Object
16 17 18 19 20 |
# File 'lib/noah/linkable.rb', line 16 def to_hash link_arr = Array.new self.links.sort.each {|l| link_arr << l.path} if self.links.size != 0 super.merge(:links => link_arr) end |
#unlink!(link_name) ⇒ Object
13 14 |
# File 'lib/noah/linkable.rb', line 13 def unlink!(link_name) end |