Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/other.rb
Overview
Class create to manage to_orient and from_orient
Direct Known Subclasses
Instance Method Summary collapse
-
#analyse ⇒ Object
used to enable def abc *key where key is a Range, an comma separated List or an item aimed to support #compose_where.
- #from_orient ⇒ Object
- #method_missing(method, *key) ⇒ Object
- #to_orient ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *key) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/other.rb', line 12 def method_missing(method, *key) #if method == :to_int # return self.first #else unless method == :to_hash || method == :to_str #|| method == :to_int return self.map{|x| x.public_send(method, *key)} # end end end |
Instance Method Details
#analyse ⇒ Object
used to enable def abc *key where key is a Range, an comma separated List or an item aimed to support #compose_where
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/other.rb', line 26 def analyse if first.is_a?(Range) first elsif size ==1 first else self end end |
#from_orient ⇒ Object
8 9 10 |
# File 'lib/other.rb', line 8 def from_orient map &:from_orient end |
#to_orient ⇒ Object
4 5 6 |
# File 'lib/other.rb', line 4 def to_orient map( &:to_orient) # .join(',') end |