Class: DMS::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/dms/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_onObject (readonly)

Returns the value of attribute expires_on.



7
8
9
# File 'lib/dms/node.rb', line 7

def expires_on
  @expires_on
end

#htmlObject (readonly)

Returns the value of attribute html.



6
7
8
# File 'lib/dms/node.rb', line 6

def html
  @html
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/dms/node.rb', line 3

def name
  @name
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/dms/node.rb', line 5

def text
  @text
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/dms/node.rb', line 4

def type
  @type
end