Class: Jerakia::Response::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/jerakia/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Entry

Returns a new instance of Entry


9
10
11
12
# File 'lib/jerakia/response.rb', line 9

def initialize(val)
  @valid = true
  set_value(val)
end

Instance Attribute Details

#datatypeObject (readonly)

Returns the value of attribute datatype


6
7
8
# File 'lib/jerakia/response.rb', line 6

def datatype
  @datatype
end

#validObject (readonly)

Returns the value of attribute valid


7
8
9
# File 'lib/jerakia/response.rb', line 7

def valid
  @valid
end

#valueObject (readonly)

Returns the value of attribute value


5
6
7
# File 'lib/jerakia/response.rb', line 5

def value
  @value
end

Instance Method Details

#invalidateObject


14
15
16
# File 'lib/jerakia/response.rb', line 14

def invalidate
  @valid = false
end

#set_value(val) ⇒ Object


22
23
24
25
# File 'lib/jerakia/response.rb', line 22

def set_value(val)
  @value = val
  @datatype = val.class.to_s.downcase
end

#valid?Boolean

Returns:

  • (Boolean)

18
19
20
# File 'lib/jerakia/response.rb', line 18

def valid?
  @valid
end