Class: Toodledo::Context
- Inherits:
-
Object
- Object
- Toodledo::Context
- Defined in:
- lib/toodledo/context.rb
Overview
A read only representation of a context.
Constant Summary collapse
- NO_CONTEXT =
Context.new(0, "No Context")
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.parse(session, el) ⇒ Object
Parses the context of an REXML element.
Instance Method Summary collapse
-
#initialize(id, name) ⇒ Context
constructor
A new instance of Context.
- #server_id ⇒ Object
- #to_s ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(id, name) ⇒ Context
Returns a new instance of Context.
8 9 10 11 |
# File 'lib/toodledo/context.rb', line 8 def initialize(id, name) @id = id @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/toodledo/context.rb', line 15 def name @name end |
Class Method Details
Instance Method Details
#server_id ⇒ Object
17 18 19 |
# File 'lib/toodledo/context.rb', line 17 def server_id return @id end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/toodledo/context.rb', line 21 def to_s() return "@[#{name}]" end |
#to_xml ⇒ Object
35 36 37 |
# File 'lib/toodledo/context.rb', line 35 def to_xml() return "<context id=\"#{@id}\">#{@name}</context>" end |