Class: Lark::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/lark/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Result

Returns a new instance of Result.



102
103
104
105
# File 'lib/lark/request.rb', line 102

def initialize(data)
  @code = data['code'].to_i
  @data = data
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



100
101
102
# File 'lib/lark/request.rb', line 100

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



100
101
102
# File 'lib/lark/request.rb', line 100

def data
  @data
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


107
108
109
# File 'lib/lark/request.rb', line 107

def success?
  code.zero?
end