Class: Cukunity::Unity::Hint

Inherits:
JSONContainer show all
Includes:
ScreenHintMethods, TextHintMethods
Defined in:
lib/cukunity/unity/hint.rb

Instance Attribute Summary collapse

Attributes inherited from JSONContainer

#json

Instance Method Summary collapse

Methods included from TextHintMethods

#reads_as?, #reads_like?, #text

Methods included from ScreenHintMethods

#intersects?, #on_screen?, #rect, #screen_pos, #tap

Methods inherited from JSONContainer

#has_key?, #keys, #method_missing, #value_of

Methods included from Cukunity::Utils

#check_timeout, #merge_options, #restrict_options, #to_options, #wait_connectivity

Constructor Details

#initialize(json, type, component) ⇒ Hint

Returns a new instance of Hint.



11
12
13
14
15
16
# File 'lib/cukunity/unity/hint.rb', line 11

def initialize(json, type, component)
  super(json)
  @type = type
  @value = json
  @component = component 
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cukunity::Unity::JSONContainer

Instance Attribute Details

#componentObject (readonly)

Returns the value of attribute component.



7
8
9
# File 'lib/cukunity/unity/hint.rb', line 7

def component
  @component
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/cukunity/unity/hint.rb', line 8

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



9
10
11
# File 'lib/cukunity/unity/hint.rb', line 9

def value
  @value
end

Instance Method Details

#gameobjectObject



18
19
20
# File 'lib/cukunity/unity/hint.rb', line 18

def gameobject
  component.gameobject
end

#to_sObject



22
23
24
# File 'lib/cukunity/unity/hint.rb', line 22

def to_s
  { type.to_s => json }.to_s
end