Class: Bananajour::Bonjour::Repository
- Inherits:
-
Object
- Object
- Bananajour::Bonjour::Repository
- Defined in:
- lib/bananajour/bonjour/repository.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#person ⇒ Object
Returns the value of attribute person.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
- #html_id ⇒ Object
-
#initialize(name, uri, person) ⇒ Repository
constructor
A new instance of Repository.
- #json_uri ⇒ Object
- #to_hash ⇒ Object
- #web_uri ⇒ Object
Constructor Details
#initialize(name, uri, person) ⇒ Repository
Returns a new instance of Repository.
5 6 7 |
# File 'lib/bananajour/bonjour/repository.rb', line 5 def initialize(name, uri, person) @name, @uri, @person = name, uri, person end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/bananajour/bonjour/repository.rb', line 3 def name @name end |
#person ⇒ Object
Returns the value of attribute person.
3 4 5 |
# File 'lib/bananajour/bonjour/repository.rb', line 3 def person @person end |
#uri ⇒ Object
Returns the value of attribute uri.
3 4 5 |
# File 'lib/bananajour/bonjour/repository.rb', line 3 def uri @uri end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 |
# File 'lib/bananajour/bonjour/repository.rb', line 13 def ==(other) self.uri == other.uri end |
#hash ⇒ Object
17 18 19 |
# File 'lib/bananajour/bonjour/repository.rb', line 17 def hash to_hash.hash end |
#html_id ⇒ Object
9 10 11 |
# File 'lib/bananajour/bonjour/repository.rb', line 9 def html_id Bananajour::Repository.html_id(name) end |
#json_uri ⇒ Object
21 22 23 |
# File 'lib/bananajour/bonjour/repository.rb', line 21 def json_uri "#{person.uri}#{name}.json" end |
#to_hash ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/bananajour/bonjour/repository.rb', line 29 def to_hash { "name" => name, "uri" => uri, "json_uri" => json_uri, "web_uri" => web_uri, "person" => person.to_hash } end |
#web_uri ⇒ Object
25 26 27 |
# File 'lib/bananajour/bonjour/repository.rb', line 25 def web_uri "#{person.uri}##{html_id}" end |