Displaying 20 results from an estimated 314 matches for "getters".
Did you mean:
letters
2015 Nov 20
1
Good practice for naming classes, builders, attributes, getters/setters for object composition
Hey everyone,
I am developing a package and I am wondering if there is a good practice
for naming classes, builders, attributes getters and setters when dealing
with object composition. I know that it is usually a good practice to give
to the builder the same name as the class and, if possible, to avoid to use
upper case letters. My problem is that, when I build an object containing
an other object (of an other class), at the end m...
2011 Jul 30
22
Question about Helpers
Studying the RoR 3 Tutorial book by Michael Hartl
and on page 345 there''s the code inside the SessionsHelper:
_________________________________________________________
module SessionsHelper
def sign_in(user)
cookies.permanent.signed[:remember_token] = [user.id, user.sault]
self.current_user = user
end
end
__________________________________________________________
What is the purpose
2010 Apr 18
1
Getter and Setter with non DB property
Hi,
I can''t find how do i created a getter and setter property for a non db
property. what i have done isnt working, i have a cnt mass assign error.
Here is what i''ve done:
attr_accessor :creator_is_participant
def creator_is_participant
@participe
end
def creator_is_participant=(participe)
if participe == true
@participe = true
else
@participe
2008 May 18
4
[LLVMdev] Opaque type usage to represent foreign types
In my project I have a group of foreign types (C++ classes) that I
want to use, but don't want to represent as structs within LLVM. For
example, for each field in each C++ class I have a setter and getter
function that I'd like to use. The setters and getters are "extern C"
functions to avoid problems with C++'s name mangling.
After going over the documentation it seems like I can do this by
creating a unique opaque type for each C++ class to track types during
my compilation, and then resolving all of the opaque types to void*
Is...
2006 Jun 01
1
Automatted Getter/Setter
Hey..
So I have a model that has a lot of number fields. Each of these go
through a process when read in and read out to add/remove commas
(between every three numbers) to make them more readable.
The getter I currently have is like this:
def sale_price
Listing.insert_commas(read_attribte (:sale_price))
end
and the setter is:
def sale_price=(price)
write_attribute(:saleprice,
2006 Jul 13
4
Does text_field go directly to attributes hash in AR object?
All,
I''m having a hell of a time figuring out what is going on here.
I''m trying to override one of my getters so that I can format it a
certain way in my form. But I can''t seem to get text_field to call the
appropriate method on my object.
So here''s my getter:
public
def FAX
fax = read_attribute(:FAX)
puts fax
sprintf("(%d)%d-%d", fax[0,3], fax[3,3], fax[6,4...
2014 Mar 05
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
This rule does not seem to be widely followed by Clang today. Looking at
Parser and Sema, many getters (0 argument functions with names matching
/^get[A-Z]/) return mutable references to long-lived objects. Looking
through Decl.h, things are a little different: we rarely return references,
but do frequently return pointers that provide mutable access to contained
objects.
On Tue, Mar 4, 2014 at 5:...
2006 Jul 03
4
text_field doesn''t call overridden ActiveRecord getters
All,
In a template, I have
<%= text_field :target_list, :DateReceived,
{ :title => ''uploaded_at'',
:class =>
''target_list_info'',
:disabled => ''true'' } %>
Here is the DateReceived method on my
2009 Oct 14
1
Cacheing computationally expensive getter methods for S4 objects
Hi,
I was wondering if there was a way to store the results of a
computationally expensive "getter" call on an S4 object, so that it is
only calculated once for each object.
Trivial example: let's say I want to cache the "expensive" area
calculation of a square object.
setClass("Square",
representation(
length='numeric',
2020 Sep 07
0
Re: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
On Sat, Sep 05, 2020 at 08:40:57PM -0500, Eric Blake wrote:
> Natural fallout after my recent testsuite additions that fixed a
> couple of ocaml bugs in the setters. However, on at least the OCaml
> code, I'm not sure what we should do if a newer libnbd ever returns a
> bit that an older NBD.mli was not expecting at the time the OCaml
> compiler ran (see below). I'm also
2014 Mar 04
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On Mar 3, 2014, at 10:29 AM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Mon, Mar 3, 2014 at 9:48 AM, Chris Lattner <sabre at nondot.org> wrote:
>> In the best case 'get' doesn't really add any meaning, and in the worst case it is actively misleading
>
> It's getting the range though, just like Function::getArgumentList() returns the
2013 Feb 05
0
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
Hi Matthew,
> In the process of porting the Polly plug-in to Windows we encountered a couple
> of issues stemming from the use (within Polly) of global data from LLVM.
>
> By far the most common occurrence of this is the definition by a class of a
> publicly accessible static ID, the address of which is used to uniquely identify
> the class. For example
>
> class
2011 May 26
0
Reference Classes: getter and setter functions/methods and possible shortcuts
Hi everyone,
just wanted to ask what's the smartest/recommended way of defining
getter and setter function *shortcuts* (i.e. something like "[", "[<-")
for Reference Class objects?
Or is it desired to not use this stuff, but define methods like
'obj$getSubset(row=1:3, col=1)' and 'obj$setSubset(value=x)' instead?
I have some example code that might
2011 Dec 02
2
[LLVMdev] deglobalizing TargetOptions
...s that the TargetOptions are all global; you could create a
>> TargetMachine targeting ARM and X86 in two threads, but they both have
>> to share the same FloatABIType setting.
>>
>> This is silly, and I plan to fix it by moving all the globals in
>> TargetOptions into getters and setters on TargetMachine. This means
>> that the TargetMachine object is going to get a bit bigger to
>> accommodate, but at least two users of llvm linked into one program
>> won't step on each other.
>
> Sounds great.
>
>> The existing command-line options...
2013 Jan 30
3
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
Hello all,
In the process of porting the Polly plug-in to Windows we encountered a
couple of issues stemming from the use (within Polly) of global data
from LLVM.
By far the most common occurrence of this is the definition by a class
of a publicly accessible static ID, the address of which is used to
uniquely identify the class. For example
class AliasAnalysis {
public:
2013 Feb 01
2
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
On Wed, Jan 30, 2013 at 12:02:47PM -0600, Matthew Curtis wrote:
> Hello all,
>
> In the process of porting the Polly plug-in to Windows we encountered a couple
> of issues stemming from the use (within Polly) of global data from LLVM.
>
> By far the most common occurrence of this is the definition by a class of a
> publicly accessible static ID, the address of which is used
2013 Feb 04
0
[LLVMdev] RFC: Replacing publicly accessible class IDs with getters
On 1/31/2013 9:07 PM, 陳韋任 (Wei-Ren Chen) wrote:
> On Wed, Jan 30, 2013 at 12:02:47PM -0600, Matthew Curtis wrote:
>> Hello all,
>>
>> In the process of porting the Polly plug-in to Windows we encountered a couple
>> of issues stemming from the use (within Polly) of global data from LLVM.
>>
>> By far the most common occurrence of this is the definition by a
2011 Dec 02
2
[LLVMdev] deglobalizing TargetOptions
...a library. One of the things that I
found is that the TargetOptions are all global; you could create a
TargetMachine targeting ARM and X86 in two threads, but they both have
to share the same FloatABIType setting.
This is silly, and I plan to fix it by moving all the globals in
TargetOptions into getters and setters on TargetMachine. This means
that the TargetMachine object is going to get a bit bigger to
accommodate, but at least two users of llvm linked into one program
won't step on each other. The existing command-line options will move
from TargetMachine into llc which will use the same se...
2008 Apr 25
3
[ANNOUNCE] Samba 3.2.0pre3
...lication manually changing or reading values in the context
structure, there are now setter and getter functions for each configurable
member in that structure. Similarly, the smbc_option_get() and
smbc_option_set() functions are deprecated in favor of the setter/getter
interface. The setters and getters are all documented in libsmbclient.h
under these comment blocks:
Getters and setters for CONFIGURATION
Getters and setters for OPTIONS
Getters and setters for FUNCTIONS
Callable functions for files
Callable functions for directories
Callable functions applicable to both files and direc...
2008 Apr 25
3
[ANNOUNCE] Samba 3.2.0pre3
...lication manually changing or reading values in the context
structure, there are now setter and getter functions for each configurable
member in that structure. Similarly, the smbc_option_get() and
smbc_option_set() functions are deprecated in favor of the setter/getter
interface. The setters and getters are all documented in libsmbclient.h
under these comment blocks:
Getters and setters for CONFIGURATION
Getters and setters for OPTIONS
Getters and setters for FUNCTIONS
Callable functions for files
Callable functions for directories
Callable functions applicable to both files and direc...