Class: Hermeneutics::Id
- Inherits:
-
Object
- Object
- Hermeneutics::Id
- Defined in:
- lib/hermeneutics/types.rb
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object (also: #inspect)
-
#initialize(value = nil) ⇒ Id
constructor
A new instance of Id.
- #to_s ⇒ Object (also: #quote)
Constructor Details
#initialize(value = nil) ⇒ Id
Returns a new instance of Id.
80 81 82 |
# File 'lib/hermeneutics/types.rb', line 80 def initialize value = nil self.value = value end |
Class Attribute Details
.host ⇒ Object
69 70 71 72 |
# File 'lib/hermeneutics/types.rb', line 69 def host require "socket" @host ||= Socket.gethostname end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
79 80 81 |
# File 'lib/hermeneutics/types.rb', line 79 def value @value end |
Class Method Details
.parse(str) {|$'| ... } ⇒ Object
73 74 75 76 77 |
# File 'lib/hermeneutics/types.rb', line 73 def parse str str =~ /<(.*?)>/ yield $' if block_given? $1 end |
Instance Method Details
#encode ⇒ Object Also known as: inspect
89 90 91 |
# File 'lib/hermeneutics/types.rb', line 89 def encode "<#{self}>" end |
#to_s ⇒ Object Also known as: quote
87 |
# File 'lib/hermeneutics/types.rb', line 87 def to_s ; @value ; end |