Class: Rubyang::Xpath::BasicType::String

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyang/xpath.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ String

Returns a new instance of String.



174
175
176
# File 'lib/rubyang/xpath.rb', line 174

def initialize value
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



173
174
175
# File 'lib/rubyang/xpath.rb', line 173

def value
  @value
end

Instance Method Details

#!=(right) ⇒ Object



193
194
195
196
197
198
199
200
201
# File 'lib/rubyang/xpath.rb', line 193

def != right
  case right
  when String
    value = (@value != right.value)
    Boolean.new value
  else
    raise
  end
end

#==(right) ⇒ Object



183
184
185
186
187
188
189
190
191
# File 'lib/rubyang/xpath.rb', line 183

def == right
  case right
  when String
    value = (@value == right.value)
    Boolean.new value
  else
    raise
  end
end

#to_booleanObject



178
179
180
181
# File 'lib/rubyang/xpath.rb', line 178

def to_boolean
  value = if @value == '' then false else true end
  Boolean.new value
end