Class: Iora::Models::Assumption

Inherits:
Element
  • Object
show all
Defined in:
lib/iora/models/assumption.rb

Overview

The Assumption class represents an element, an element used by the Wolfram Alpha API to describe assumptions used and give the user the option of changing them.

Instance Attribute Summary

Attributes inherited from Element

#element

Instance Method Summary collapse

Methods inherited from Element

#initialize, #to_xml

Methods included from Associations::HasOne

#has_one

Methods included from Associations::Helpers

#parse_element, #tag_for

Methods included from Associations::HasMany

#has_many

Methods included from Associations::HasAttribute

#has_attribute

Constructor Details

This class inherits a constructor from Iora::Models::Element

Instance Method Details

#assumed_valueAssumptionValue

Returns the actively assumed value.

Returns:


27
28
29
# File 'lib/iora/models/assumption.rb', line 27

def assumed_value
  values.first
end

#typeString

Returns the class of the assumption.

Returns:

  • (String)

    the class of the assumption


13
# File 'lib/iora/models/assumption.rb', line 13

has_attribute :type

#valuesArray<AssumptionValue>

Returns the possible assumptions. The first element in the array is the actively assumed value.

Returns:

  • (Array<AssumptionValue>)

    the possible assumptions. The first element in the array is the actively assumed value.

See Also:


23
# File 'lib/iora/models/assumption.rb', line 23

has_many :values, AssumptionValue

#wordString

Returns the word or phrase to which the assumption is applied.

Returns:

  • (String)

    the word or phrase to which the assumption is applied


17
# File 'lib/iora/models/assumption.rb', line 17

has_attribute :word