class Libexttextcat::Candidates
Public Instance Methods
static VALUE
rbe_candidates_m_get (VALUE self, VALUE index)
{
RbeCandidates *cs = rb_check_typeddata (self, &rbe_candidates_type);
size_t i = RB_NUM2SIZE (index);
if (i >= cs->num)
rb_raise (rbe_eError, "out of range");
VALUE v = rb_obj_alloc (rbe_cCandidate);
RTYPEDDATA_DATA (v) = &cs->candidates[i];
return v;
}
# File lib/libexttextcat.rb, line 41 def each block_given? and return enum_for(:each) (0...length).each do |i| yield self[i] end self end
Yields Libexttextcat::Candidate.
Source
static VALUE
rbe_candidates_m_length (VALUE self)
{
RbeCandidates *cs = rb_check_typeddata (self, &rbe_candidates_type);
return RB_SIZE2NUM (cs->num);
}
Also aliased as: size