Class: DataKitten::Agent
- Inherits:
-
Object
- Object
- DataKitten::Agent
- Defined in:
- lib/data_kitten/agent.rb
Overview
A person or organisation.
Naming is based on foaf:Agent, but with useful aliases for other vocabularies.
Instance Attribute Summary collapse
-
#homepage ⇒ String
(also: #url, #uri)
The homepage URL of the Agent.
-
#mbox ⇒ String
(also: #email)
The email address of the Agent.
-
#name ⇒ String
The name of the Agent.
Instance Method Summary collapse
- #==(agent) ⇒ Object
-
#initialize(options) ⇒ Agent
constructor
Create a new Agent.
Constructor Details
#initialize(options) ⇒ Agent
Create a new Agent
15 16 17 18 19 |
# File 'lib/data_kitten/agent.rb', line 15 def initialize() @name = [:name] @homepage = [:homepage] @mbox = [:mbox] end |
Instance Attribute Details
#homepage ⇒ String Also known as: url, uri
Returns the homepage URL of the Agent.
27 28 29 |
# File 'lib/data_kitten/agent.rb', line 27 def homepage @homepage end |
#mbox ⇒ String Also known as: email
Returns the email address of the Agent.
33 34 35 |
# File 'lib/data_kitten/agent.rb', line 33 def mbox @mbox end |
#name ⇒ String
Returns the name of the Agent.
23 24 25 |
# File 'lib/data_kitten/agent.rb', line 23 def name @name end |
Instance Method Details
#==(agent) ⇒ Object
36 37 38 |
# File 'lib/data_kitten/agent.rb', line 36 def ==(agent) agent.is_a?(Agent) && ([name, homepage, mbox] == [agent.name, agent.homepage, agent.mbox]) end |