| Copyright | (c) Philip Cunningham 2015 |
|---|---|
| License | MIT |
| Maintainer | hello@filib.io |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Ruby.Marshal.RubyObject
Description
Core RubyObject data representation.
Synopsis
- data RubyObject
- = RNil
- | RBool !Bool
- | RFixnum !Int
- | RArray !(Vector RubyObject)
- | RHash !(Vector (RubyObject, RubyObject))
- | RIVar !(RubyObject, RubyStringEncoding)
- | RString !ByteString
- | RFloat !Float
- | RSymbol !ByteString
- | Unsupported
- class Rubyable a where
- toRuby :: a -> RubyObject
- fromRuby :: RubyObject -> Maybe a
Documentation
data RubyObject Source #
Representation of a Ruby object.
Constructors
| RNil | represents |
| RBool !Bool | represents |
| RFixnum !Int | represents a |
| RArray !(Vector RubyObject) | represents an |
| RHash !(Vector (RubyObject, RubyObject)) | represents an |
| RIVar !(RubyObject, RubyStringEncoding) | represents an |
| RString !ByteString | represents a |
| RFloat !Float | represents a |
| RSymbol !ByteString | represents a |
| Unsupported | represents an invalid object |
Instances
| Eq RubyObject Source # | |
Defined in Data.Ruby.Marshal.RubyObject | |
| Ord RubyObject Source # | |
Defined in Data.Ruby.Marshal.RubyObject Methods compare :: RubyObject -> RubyObject -> Ordering # (<) :: RubyObject -> RubyObject -> Bool # (<=) :: RubyObject -> RubyObject -> Bool # (>) :: RubyObject -> RubyObject -> Bool # (>=) :: RubyObject -> RubyObject -> Bool # max :: RubyObject -> RubyObject -> RubyObject # min :: RubyObject -> RubyObject -> RubyObject # | |
| Show RubyObject Source # | |
Defined in Data.Ruby.Marshal.RubyObject Methods showsPrec :: Int -> RubyObject -> ShowS # show :: RubyObject -> String # showList :: [RubyObject] -> ShowS # | |
| Rubyable RubyObject Source # | |
Defined in Data.Ruby.Marshal.RubyObject Methods toRuby :: RubyObject -> RubyObject Source # fromRuby :: RubyObject -> Maybe RubyObject Source # | |
class Rubyable a where Source #
Transform plain Haskell values to RubyObjects and back.
Methods
toRuby :: a -> RubyObject Source #
Takes a plain Haskell value and lifts into RubyObject
fromRuby :: RubyObject -> Maybe a Source #
Takes a RubyObject transforms it into a more general Haskell value.