Class: DMS::Node
- Inherits:
-
Object
- Object
- DMS::Node
- Defined in:
- lib/dms/node.rb
Instance Attribute Summary collapse
-
#expires_on ⇒ Object
readonly
Returns the value of attribute expires_on.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(response) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(response) ⇒ Node
Returns a new instance of Node.
9 10 11 12 13 14 15 16 17 |
# File 'lib/dms/node.rb', line 9 def initialize(response) @response = response hash = @response.parsed_response.values.first @name = hash["name"] @type = hash["type"] @text = hash["body"] @html = hash["html"] @expires_on = Date.parse(hash["expires_on"]) rescue nil end |
Instance Attribute Details
#expires_on ⇒ Object (readonly)
Returns the value of attribute expires_on.
7 8 9 |
# File 'lib/dms/node.rb', line 7 def expires_on @expires_on end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
6 7 8 |
# File 'lib/dms/node.rb', line 6 def html @html end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/dms/node.rb', line 3 def name @name end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/dms/node.rb', line 5 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/dms/node.rb', line 4 def type @type end |