Class: NotionRubyMapping::EquationObject

Inherits:
RichTextObject show all
Defined in:
lib/notion_ruby_mapping/objects/equation_object.rb

Overview

EquationObject

Instance Attribute Summary collapse

Attributes inherited from RichTextObject

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RichTextObject

#bold=, #clear_will_update, #code=, #color=, create_from_json, #href=, #italic=, #plain_text=, #property_values_json, #strikethrough=, text_object, #underline=

Constructor Details

#initialize(expression, options = {}) ⇒ TextObject

Parameters:

  • expression (String)


8
9
10
11
12
# File 'lib/notion_ruby_mapping/objects/equation_object.rb', line 8

def initialize(expression, options = {})
  super "equation", {"plain_text" => expression}.merge(options)
  @expression = expression
  @will_update = false
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



13
14
15
# File 'lib/notion_ruby_mapping/objects/equation_object.rb', line 13

def expression
  @expression
end

#will_updateObject (readonly)

Returns the value of attribute will_update.



13
14
15
# File 'lib/notion_ruby_mapping/objects/equation_object.rb', line 13

def will_update
  @will_update
end

Class Method Details

.equation_object(expression_or_eo) ⇒ EquationObject

Returns self or created EquationObject.



18
19
20
21
22
23
24
# File 'lib/notion_ruby_mapping/objects/equation_object.rb', line 18

def self.equation_object(expression_or_eo)
  if expression_or_eo.is_a? EquationObject
    expression_or_eo
  else
    EquationObject.new expression_or_eo
  end
end

Instance Method Details

#textString (frozen)

Returns:

  • (String (frozen))


35
36
37
# File 'lib/notion_ruby_mapping/objects/equation_object.rb', line 35

def text
  @expression
end