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
#eat_lines, #rewind, #to_gray, #to_rgb
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
63 64 65 |
# File 'lib/hermeneutics/types.rb', line 63 def host @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 |