Class: Coopy::SimpleView
- Inherits:
-
Object
- Object
- Coopy::SimpleView
- Defined in:
- lib/lib/coopy/simple_view.rb
Instance Method Summary collapse
- #equals(d1, d2) ⇒ Object
- #get_table(t) ⇒ Object
- #hash_exists(h, str) ⇒ Object
- #hash_get(h, str) ⇒ Object
- #hash_set(h, str, d) ⇒ Object
-
#initialize ⇒ SimpleView
constructor
A new instance of SimpleView.
- #is_hash(h) ⇒ Object
- #is_table(t) ⇒ Object
- #make_hash ⇒ Object
- #to_datum(x) ⇒ Object
- #to_s(d) ⇒ Object
- #wrap_table(t) ⇒ Object
Constructor Details
#initialize ⇒ SimpleView
Returns a new instance of SimpleView.
7 8 |
# File 'lib/lib/coopy/simple_view.rb', line 7 def initialize end |
Instance Method Details
#equals(d1, d2) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/lib/coopy/simple_view.rb', line 15 def equals(d1,d2) return true if d1 == nil && d2 == nil return true if d1 == nil && "" + _hx_str(d2.to_s) == "" return true if "" + _hx_str(d1.to_s) == "" && d2 == nil "" + _hx_str(d1.to_s) == "" + _hx_str(d2.to_s) end |
#get_table(t) ⇒ Object
59 60 61 |
# File 'lib/lib/coopy/simple_view.rb', line 59 def get_table(t) t end |
#hash_exists(h, str) ⇒ Object
41 42 43 44 |
# File 'lib/lib/coopy/simple_view.rb', line 41 def hash_exists(h,str) hh = h hh.include?(str) end |
#hash_get(h, str) ⇒ Object
46 47 48 49 |
# File 'lib/lib/coopy/simple_view.rb', line 46 def hash_get(h,str) hh = h hh[str] end |
#hash_set(h, str, d) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lib/coopy/simple_view.rb', line 30 def hash_set(h,str,d) hh = h begin value = d begin value1 = value hh[str] = value1 end end end |
#is_hash(h) ⇒ Object
51 52 53 |
# File 'lib/lib/coopy/simple_view.rb', line 51 def is_hash(h) h.respond_to? :keys end |
#is_table(t) ⇒ Object
55 56 57 |
# File 'lib/lib/coopy/simple_view.rb', line 55 def is_table(t) Std._is(t,::Coopy::Table) end |
#make_hash ⇒ Object
26 27 28 |
# File 'lib/lib/coopy/simple_view.rb', line 26 def make_hash {} end |
#to_datum(x) ⇒ Object
22 23 24 |
# File 'lib/lib/coopy/simple_view.rb', line 22 def to_datum(x) x end |
#to_s(d) ⇒ Object
10 11 12 13 |
# File 'lib/lib/coopy/simple_view.rb', line 10 def to_s(d) return "" if d == nil "" + _hx_str(d.to_s) end |
#wrap_table(t) ⇒ Object
63 64 65 |
# File 'lib/lib/coopy/simple_view.rb', line 63 def wrap_table(t) t end |