Class: Hermeneutics::Id
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object (also: #inspect)
-
#initialize(id = nil) ⇒ Id
constructor
A new instance of Id.
Methods inherited from String
Constructor Details
#initialize(id = nil) ⇒ Id
Returns a new instance of Id.
73 74 75 |
# File 'lib/hermeneutics/types.rb', line 73 def initialize id = nil super id || generate end |
Class Attribute Details
.host ⇒ Object
62 63 64 65 |
# File 'lib/hermeneutics/types.rb', line 62 def host require "socket" @host ||= Socket.gethostname end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
72 73 74 |
# File 'lib/hermeneutics/types.rb', line 72 def id @id end |
Class Method Details
.parse(str) {|$'| ... } ⇒ Object
66 67 68 69 70 |
# File 'lib/hermeneutics/types.rb', line 66 def parse str str =~ /<(.*?)>/ yield $' if block_given? $1 end |
Instance Method Details
#encode ⇒ Object Also known as: inspect
77 78 79 |
# File 'lib/hermeneutics/types.rb', line 77 def encode "<#{self}>" end |